diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/string.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/string.c b/lib/string.c index 112389ed554a..b7df79574a57 100644 --- a/lib/string.c +++ b/lib/string.c @@ -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 |
