]> git.sur5r.net Git - openldap/commitdiff
fix arbitrary precision number display when no big number library is available
authorPierangelo Masarati <ando@openldap.org>
Tue, 19 Jul 2005 21:56:15 +0000 (21:56 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 19 Jul 2005 21:56:15 +0000 (21:56 +0000)
servers/slapd/proto-slap.h

index aa126e2ef86503f352a30e9e5e4bceb553ad4ca6..c632c6145cbbea68ba17dcee37345d682a8517e1 100644 (file)
@@ -1681,11 +1681,11 @@ LDAP_SLAPD_F (int) fe_extended LDAP_P((Operation *op, SlapReply *rs));
        do { \
                char            buf[] = "+9223372036854775807L"; \
                ber_len_t       len; \
-               snprintf( buf, sizeof( buf ), UI2BV_FORMAT, (ui) ); \
-               len = strlen( buf ); \
+               len = snprintf( buf, sizeof( buf ), UI2BV_FORMAT, (ui) ); \
                if ( len > (bv)->bv_len ) { \
                        (bv)->bv_val = ber_memrealloc_x( (bv)->bv_val, len + 1, (ctx) ); \
                } \
+               (bv)->bv_len = len; \
                AC_MEMCPY( (bv)->bv_val, buf, len + 1 ); \
        } while ( 0 )
 #endif /* ! HAVE_GMP */