
From: Yoshinori Sato <ysato@users.sourceforge.jp>

It writes one too many zeroes when nulling out the destination.



 25-akpm/lib/string.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN lib/string.c~strncpy-off-by-one-fix lib/string.c
--- 25/lib/string.c~strncpy-off-by-one-fix	Tue Aug 12 14:09:25 2003
+++ 25-akpm/lib/string.c	Tue Aug 12 14:09:25 2003
@@ -89,7 +89,7 @@ char * strncpy(char * dest,const char *s
 
 	while (count && (*dest++ = *src++) != '\0')
 		count--;
-	while (count) {
+	while (count > 1) {
 		*dest++ = 0;
 		count--;
 	}

_
