From: Pierangelo Masarati Date: Tue, 19 Jul 2005 19:31:24 +0000 (+0000) Subject: use appropriate format when no arbitrary precision library is available X-Git-Tag: OPENLDAP_AC_BP~317 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=499906f46484555ca46c2f16a4d8b1b4561555ea;p=openldap use appropriate format when no arbitrary precision library is available --- diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 4a7c005771..aa126e2ef8 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -1672,11 +1672,16 @@ LDAP_SLAPD_F (int) fe_extended LDAP_P((Operation *op, SlapReply *rs)); (bv)->bv_len = len; \ } while ( 0 ) #else /* ! HAVE_BIGNUM && ! HAVE_GMP */ +#ifdef HAVE_LONG_LONG +#define UI2BV_FORMAT "%llu" +#else /* ! HAVE_LONG_LONG */ +#define UI2BV_FORMAT "%lu" +#endif /* ! HAVE_LONG_LONG */ #define UI2BVX(bv,ui,ctx) \ do { \ char buf[] = "+9223372036854775807L"; \ ber_len_t len; \ - snprintf( buf, sizeof( buf ), "%lu", (ui) ); \ + snprintf( buf, sizeof( buf ), UI2BV_FORMAT, (ui) ); \ len = strlen( buf ); \ if ( len > (bv)->bv_len ) { \ (bv)->bv_val = ber_memrealloc_x( (bv)->bv_val, len + 1, (ctx) ); \