]> git.sur5r.net Git - openldap/commitdiff
Tweak strcpy's
authorHoward Chu <hyc@openldap.org>
Sat, 12 Apr 2003 12:20:19 +0000 (12:20 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 12 Apr 2003 12:20:19 +0000 (12:20 +0000)
servers/slapd/ad.c

index cc3e7c1674a8fadcc73bf89e69618c8cf80ca66f..569e995ccbc5f5ecbb7afd319c0fe74caa919f24 100644 (file)
@@ -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 )