diff options
Diffstat (limited to 'lib/libc/string/strncpy.c')
-rw-r--r-- | lib/libc/string/strncpy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/string/strncpy.c b/lib/libc/string/strncpy.c index 07b9166..980dbc7 100644 --- a/lib/libc/string/strncpy.c +++ b/lib/libc/string/strncpy.c @@ -50,10 +50,10 @@ strncpy(char * __restrict dst, const char * __restrict src, size_t n) const char *s = src; do { - if ((*d++ = *s++) == 0) { + if ((*d++ = *s++) == '\0') { /* NUL pad the remaining n-1 bytes */ while (--n != 0) - *d++ = 0; + *d++ = '\0'; break; } } while (--n != 0); |