From: Volker Lendecke Date: Mon, 31 Dec 2018 06:16:29 +0000 (+0100) Subject: lib: Remove StrnCpy X-Git-Tag: tdb-1.3.17~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc0664dd0453c85147b4b270bddb418bb1d4d0a9;p=thirdparty%2Fsamba.git lib: Remove StrnCpy Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/proto.h b/source3/include/proto.h index d2f9986c244..c92d9921d6e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -574,7 +574,6 @@ size_t str_charnum(const char *s); bool trim_char(char *s,char cfront,char cback); bool strhasupper(const char *s); bool strhaslower(const char *s); -char *StrnCpy(char *dest,const char *src,size_t n); bool in_list(const char *s, const char *list, bool casesensitive); void fstring_sub(char *s,const char *pattern,const char *insert); char *realloc_string_sub2(char *string, diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index eb36478d8a2..8568af46c17 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -170,32 +170,6 @@ bool trim_char(char *s,char cfront,char cback) return ret; } -/** - Like strncpy but always null terminates. Make sure there is room! - The variable n should always be one less than the available size. -**/ -char *StrnCpy(char *dest,const char *src,size_t n) -{ - char *d = dest; - - if (!dest) { - smb_panic("ERROR: NULL dest in StrnCpy"); - } - - if (!src) { - *dest = 0; - return(dest); - } - - while (n-- && (*d = *src)) { - d++; - src++; - } - - *d = 0; - return(dest); -} - /** Check if a string is part of a list. **/