Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Oct 2008 09:10:45 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184055 - head/lib/libc/string
Message-ID:  <200810190910.m9J9Ajmj038999@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Sun Oct 19 09:10:44 2008
New Revision: 184055
URL: http://svn.freebsd.org/changeset/base/184055

Log:
  Further simplify the code.
  
  Submitted by:	Christoph Mallon <christoph.mallon gmx.de>

Modified:
  head/lib/libc/string/strxfrm.c

Modified: head/lib/libc/string/strxfrm.c
==============================================================================
--- head/lib/libc/string/strxfrm.c	Sun Oct 19 09:08:59 2008	(r184054)
+++ head/lib/libc/string/strxfrm.c	Sun Oct 19 09:10:44 2008	(r184055)
@@ -45,17 +45,8 @@ strxfrm(char * __restrict dest, const ch
 		return 0;
 	}
 
-	if (__collate_load_error) {
-		slen = strlen(src);
-		if (len > 0) {
-			if (slen < len)
-				strcpy(dest, src);
-			else {
-				strlcpy(dest, src, len);
-			}
-		}
-		return slen;
-	}
+	if (__collate_load_error)
+		return strlcpy(dest, src, len);
 
 	slen = 0;
 	prim = sec = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810190910.m9J9Ajmj038999>