]> git.sur5r.net Git - openldap/commitdiff
STRLENOF cleanup
authorPierangelo Masarati <ando@openldap.org>
Tue, 27 Apr 2004 21:40:54 +0000 (21:40 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 27 Apr 2004 21:40:54 +0000 (21:40 +0000)
include/lber_pvt.h
servers/slapd/globals.c

index ffc09626bce15cfea4c42c07a01d7ffafd444f88..0afea13fa17c03363a07dcc2260b67fe4158e973 100644 (file)
@@ -165,7 +165,7 @@ ber_bvarray_add_x LDAP_P(( BerVarray *p, BerValue *bv, void *ctx ));
 #define ber_bvchr(bv,c) \
        memchr( (bv)->bv_val, (c), (bv)->bv_len )
 
-#define BER_BVC(s)             { sizeof(s) - 1, (s) }
+#define BER_BVC(s)             { STRLENOF(s), (s) }
 #define BER_BVNULL             { 0L, NULL }
 #define BER_BVZERO(bv) \
        do { \
@@ -174,7 +174,7 @@ ber_bvarray_add_x LDAP_P(( BerVarray *p, BerValue *bv, void *ctx ));
        } while (0)
 #define BER_BVSTR(bv,s)        \
        do { \
-               (bv)->bv_len = sizeof(s)-1; \
+               (bv)->bv_len = STRLENOF(s); \
                (bv)->bv_val = (s); \
        } while (0)
 #define BER_BVISNULL(bv)       ((bv)->bv_val == NULL)
index 42bbe8d1ca14e1fb5d589cf0dbe65e3a8791006c..5039069fd8a07cae574ea31604acfef80f5c8662 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "portable.h"
 
+#include <ac/string.h>
 #include "lber_pvt.h"
 
 #include "slap.h"