From 088eecc34d715e1762b257ca9b8b3736e804ec1f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 12 Apr 2003 12:20:19 +0000 Subject: [PATCH] Tweak strcpy's --- servers/slapd/ad.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index cc3e7c1674..569e995ccb 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -17,6 +17,7 @@ #include "ldap_pvt.h" #include "slap.h" +#include "lutil.h" typedef struct Attr_option { struct berval name; /* option name or prefix */ @@ -352,16 +353,13 @@ done:; j = (lp ? lp - desc.ad_tags.bv_val - 1 : strlen( desc.ad_tags.bv_val )); - strncpy(cp, desc.ad_tags.bv_val, j); - cp += j; + cp = lutil_strncopy(cp, desc.ad_tags.bv_val, j); } } - strcpy(cp, ";binary"); - cp += sizeof(";binary")-1; + cp = lutil_strcopy(cp, ";binary"); if( lp != NULL ) { *cp++ = ';'; - strcpy(cp, lp); - cp += strlen( cp ); + cp = lutil_strcopy(cp, lp); } d2->ad_cname.bv_len = cp - d2->ad_cname.bv_val; if( desc.ad_tags.bv_len ) -- 2.39.5