From b5ed840a17beaf20195c0c06ab7b0d7dc13e97d0 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 8 May 2005 00:45:58 +0000 Subject: [PATCH] Fix bad macro interaction in prev commit --- servers/slapd/entry.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index 85fbba3ab8..a6e548b934 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -571,7 +571,8 @@ void entry_partsize(Entry *e, ber_len_t *plen, } } len += entry_lenlen(0); /* NUL byte at end */ - len += entry_lenlen(nat) + entry_lenlen(nval); + len += entry_lenlen(nat); + len += entry_lenlen(nval); *plen = len; *pnattrs = nat; *pnvals = nval; @@ -632,23 +633,23 @@ int entry_encode(Entry *e, struct berval *bv) *ptr++ = '\0'; if (a->a_vals) { for (i=0; a->a_vals[i].bv_val; i++); - entry_putlen(&ptr, i); - for (i=0; a->a_vals[i].bv_val; i++) { - entry_putlen(&ptr, a->a_vals[i].bv_len); - AC_MEMCPY(ptr, a->a_vals[i].bv_val, - a->a_vals[i].bv_len); - ptr += a->a_vals[i].bv_len; - *ptr++ = '\0'; - } - if (a->a_nvals != a->a_vals) { entry_putlen(&ptr, i); - for (i=0; a->a_nvals[i].bv_val; i++) { - entry_putlen(&ptr, a->a_nvals[i].bv_len); - AC_MEMCPY(ptr, a->a_nvals[i].bv_val, - a->a_nvals[i].bv_len); - ptr += a->a_nvals[i].bv_len; + for (i=0; a->a_vals[i].bv_val; i++) { + entry_putlen(&ptr, a->a_vals[i].bv_len); + AC_MEMCPY(ptr, a->a_vals[i].bv_val, + a->a_vals[i].bv_len); + ptr += a->a_vals[i].bv_len; *ptr++ = '\0'; } + if (a->a_nvals != a->a_vals) { + entry_putlen(&ptr, i); + for (i=0; a->a_nvals[i].bv_val; i++) { + entry_putlen(&ptr, a->a_nvals[i].bv_len); + AC_MEMCPY(ptr, a->a_nvals[i].bv_val, + a->a_nvals[i].bv_len); + ptr += a->a_nvals[i].bv_len; + *ptr++ = '\0'; + } } else { entry_putlen(&ptr, 0); } -- 2.39.5