diff --git a/include/lber_pvt.h b/include/lber_pvt.h index ffc09626bce15cfea4c42c07a01d7ffafd444f88..0afea13fa17c03363a07dcc2260b67fe4158e973 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 42bbe8d1ca14e1fb5d589cf0dbe65e3a8791006c..5039069fd8a07cae574ea31604acfef80f5c8662 100644 --- a/servers/slapd/globals.c +++ b/servers/slapd/globals.c @@ -16,6 +16,7 @@ #include "portable.h" +#include <ac/string.h> #include "lber_pvt.h" #include "slap.h"