svn commit: samba r15302 - in branches/SAMBA_4_0/source: lib/util param

jelmer at samba.org jelmer at samba.org
Thu Apr 27 22:59:22 GMT 2006


Author: jelmer
Date: 2006-04-27 22:59:20 +0000 (Thu, 27 Apr 2006)
New Revision: 15302

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15302

Log:
Remove strangely named function "StrnCpy" - strlcpy is available as a 
replacement.

Modified:
   branches/SAMBA_4_0/source/lib/util/util_str.c
   branches/SAMBA_4_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/util_str.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/util_str.c	2006-04-27 21:46:44 UTC (rev 15301)
+++ branches/SAMBA_4_0/source/lib/util/util_str.c	2006-04-27 22:59:20 UTC (rev 15302)
@@ -172,27 +172,6 @@
 }
 
 /**
- 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

Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c	2006-04-27 21:46:44 UTC (rev 15301)
+++ branches/SAMBA_4_0/source/param/loadparm.c	2006-04-27 22:59:20 UTC (rev 15302)
@@ -759,11 +759,11 @@
 	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);



More information about the samba-cvs mailing list