Commit 5617bd56 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] fix strncpy on generic user platforms

parent c67574a3
......@@ -80,8 +80,7 @@ char * strcpy(char * dest,const char *src)
* @src: Where to copy the string from
* @count: The maximum number of bytes to copy
*
* Note that unlike userspace strncpy, this does not %NUL-pad the buffer.
* However, the result is not %NUL-terminated if the source exceeds
* The result is not %NUL-terminated if the source exceeds
* @count bytes.
*/
char * strncpy(char * dest,const char *src,size_t count)
......@@ -90,7 +89,8 @@ char * strncpy(char * dest,const char *src,size_t count)
while (count-- && (*dest++ = *src++) != '\0')
/* nothing */;
while (count-- > 0)
*dest++ = 0;
return tmp;
}
#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