use appropriate format when no arbitrary precision library is available

This commit is contained in:
Pierangelo Masarati 2005-07-19 19:31:24 +00:00
parent c4aedadc56
commit 499906f464

View File

@ -1672,11 +1672,16 @@ LDAP_SLAPD_F (int) fe_extended LDAP_P((Operation *op, SlapReply *rs));
(bv)->bv_len = len; \ (bv)->bv_len = len; \
} while ( 0 ) } while ( 0 )
#else /* ! HAVE_BIGNUM && ! HAVE_GMP */ #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) \ #define UI2BVX(bv,ui,ctx) \
do { \ do { \
char buf[] = "+9223372036854775807L"; \ char buf[] = "+9223372036854775807L"; \
ber_len_t len; \ ber_len_t len; \
snprintf( buf, sizeof( buf ), "%lu", (ui) ); \ snprintf( buf, sizeof( buf ), UI2BV_FORMAT, (ui) ); \
len = strlen( buf ); \ len = strlen( buf ); \
if ( len > (bv)->bv_len ) { \ if ( len > (bv)->bv_len ) { \
(bv)->bv_val = ber_memrealloc_x( (bv)->bv_val, len + 1, (ctx) ); \ (bv)->bv_val = ber_memrealloc_x( (bv)->bv_val, len + 1, (ctx) ); \