From: Howard Chu Date: Mon, 1 Dec 2025 15:09:21 +0000 (+0000) Subject: ITS#10410 WIN32 logging: simplify buffer calculation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afafeaf4074d5a0c1001696cc6df35d2b0d077ff;p=thirdparty%2Fopenldap.git ITS#10410 WIN32 logging: simplify buffer calculation --- diff --git a/servers/slapd/logging.c b/servers/slapd/logging.c index 5874538745..2c93c38fa4 100644 --- a/servers/slapd/logging.c +++ b/servers/slapd/logging.c @@ -118,8 +118,9 @@ slap_debug_print( const char *data ) poffset = splen - prefixlen; AC_MEMCPY( ptr+poffset, ptr, prefixlen ); } + ptr += poffset+prefixlen; - ptr = lutil_strncopy( ptr+poffset+prefixlen, data, sizeof(msgbuf) - prefixlen); + ptr = lutil_strncopy( ptr, data, sizeof(msgbuf) - (ptr-msgbuf) ); len = ptr - msgbuf - poffset; datalen = len - prefixlen; if ( !logfile_only )