From bd604b4b064135e661660c045cd31145e2e4ce71 Mon Sep 17 00:00:00 2001 From: Daniel Gerzo Date: Tue, 3 Feb 2009 17:58:20 +0000 Subject: - ANSIfy function definitions - use nul when we are looking for a terminating character where appropriate Approved by: imp --- lib/libc/string/strncpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/string/strncpy.c') diff --git a/lib/libc/string/strncpy.c b/lib/libc/string/strncpy.c index 07b9166d2b26..980dbc7d58e8 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); -- cgit v1.2.3