diff options
-rw-r--r-- | lib/libc/net/ascii2addr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/net/ascii2addr.c b/lib/libc/net/ascii2addr.c index 415d07d..0b5bab4 100644 --- a/lib/libc/net/ascii2addr.c +++ b/lib/libc/net/ascii2addr.c @@ -51,7 +51,8 @@ ascii2addr(af, ascii, result) switch(af) { case AF_INET: ina = result; - strncpy(strbuf, ascii, (sizeof strbuf)-1); + strbuf[0] = '\0'; + strncat(strbuf, ascii, (sizeof strbuf)-1); if (inet_aton(strbuf, ina)) return sizeof(struct in_addr); errno = EINVAL; |