Commit b2e268b3 authored by David S. Miller's avatar David S. Miller

[STRING]: Fix bug in generic strncpy() change.

parent 06f13207
...@@ -87,10 +87,12 @@ char * strncpy(char * dest,const char *src,size_t count) ...@@ -87,10 +87,12 @@ char * strncpy(char * dest,const char *src,size_t count)
{ {
char *tmp = dest; char *tmp = dest;
while (count-- && (*dest++ = *src++) != '\0') while (count && (*dest++ = *src++) != '\0')
/* nothing */; count--;
while (count-- > 0) while (count) {
*dest++ = 0; *dest++ = 0;
count--;
}
return tmp; return tmp;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment