Explorar o código

fixed strlcpy()

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@502 bbd45198-f89e-11dd-88c7-29a3b14d5316
gary.li.wenchao.4 %!s(int64=15) %!d(string=hai) anos
pai
achega
3cc54e91bf
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      libc/minilibc/string.c

+ 1 - 1
libc/minilibc/string.c

@@ -38,7 +38,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz)
 	register size_t n = siz;
 
 	/* Copy as many bytes as will fit */
-	if (n != 0 && --n != 0)
+	if (n != 0)
 	{
 		do
 		{