From: Pierangelo Masarati Date: Tue, 27 Apr 2004 21:40:54 +0000 (+0000) Subject: STRLENOF cleanup X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~417 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=60b05c643db29f1e2fa8156af43389a7f95756bd;p=openldap STRLENOF cleanup --- diff --git a/include/lber_pvt.h b/include/lber_pvt.h index ffc09626bc..0afea13fa1 100644 --- a/include/lber_pvt.h +++ b/include/lber_pvt.h @@ -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) diff --git a/servers/slapd/globals.c b/servers/slapd/globals.c index 42bbe8d1ca..5039069fd8 100644 --- a/servers/slapd/globals.c +++ b/servers/slapd/globals.c @@ -16,6 +16,7 @@ #include "portable.h" +#include #include "lber_pvt.h" #include "slap.h"