diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/util/util_str.c | 21 | ||||
-rw-r--r-- | source4/param/loadparm.c | 4 |
2 files changed, 2 insertions, 23 deletions
diff --git a/source4/lib/util/util_str.c b/source4/lib/util/util_str.c index 60419e0510..34d37ecfbd 100644 --- a/source4/lib/util/util_str.c +++ b/source4/lib/util/util_str.c @@ -172,27 +172,6 @@ _PUBLIC_ char *safe_strcat(char *dest, const char *src, size_t maxlength) } /** - Like strncpy but always null terminates. Make sure there is room! - The variable n should always be one less than the available size. -**/ - -_PUBLIC_ char *StrnCpy(char *dest,const char *src,size_t n) -{ - char *d = dest; - if (!dest) - return(NULL); - if (!src) { - *dest = 0; - return(dest); - } - while (n-- && (*d++ = *src++)) - ; - *d = 0; - return(dest); -} - - -/** Routine to get hex characters and turn them into a 16 byte array. the array can be variable length, and any non-hex-numeric characters are skipped. "0xnn" or "0Xnn" is specially catered diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index a033e0815c..b6dec9be9d 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -759,11 +759,11 @@ static const char *lp_string(const char *s) if (!s) *ret = 0; else - StrnCpy(ret, s, len); + strlcpy(ret, s, len); if (trim_string(ret, "\"", "\"")) { if (strchr(ret,'"') != NULL) - StrnCpy(ret, s, len); + strlcpy(ret, s, len); } standard_sub_basic(ret,len+100); |