aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid S. Miller <davem@kernel.bkbits.net>2003-08-01 04:01:37 -0700
committerDavid S. Miller <davem@kernel.bkbits.net>2003-08-01 04:01:37 -0700
commitff8ff505cd1145f839382df7ce80f8aca6d5baad (patch)
treec68c972ad54e48f4490109e7bb97ed4b140ccdcb /lib
parent8128c97e80740b87eb87fc4c813ae9c930abcca0 (diff)
parent5899bb53f373d6a75b6083a7e879717d439fd48b (diff)
downloadhistory-ff8ff505cd1145f839382df7ce80f8aca6d5baad.tar.gz
Merge davem@nuts.ninka.net:/home/davem/src/BK/sparc-2.5
into kernel.bkbits.net:/home/davem/sparc-2.5
Diffstat (limited to 'lib')
-rw-r--r--lib/string.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/string.c b/lib/string.c
index b7df79574a5730..d50185536bf377 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -87,10 +87,12 @@ char * strncpy(char * dest,const char *src,size_t count)
{
char *tmp = dest;
- while (count-- && (*dest++ = *src++) != '\0')
- /* nothing */;
- while (count-- > 0)
+ while (count && (*dest++ = *src++) != '\0')
+ count--;
+ while (count) {
*dest++ = 0;
+ count--;
+ }
return tmp;
}
#endif