From: Simon Tatham Date: Fri, 20 Sep 2002 17:54:17 +0000 (+0000) Subject: Use memcpy rather than strncpy in sk_addrcopy! How did that happen? X-Git-Tag: 0.53~14 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=79fa4f8cd6cc607c49ba7902935da42b5b2a3aaf;p=PuTTY.git Use memcpy rather than strncpy in sk_addrcopy! How did that happen? [originally from svn r1968] --- diff --git a/winnet.c b/winnet.c index 5b853e10..7cadf86f 100644 --- a/winnet.c +++ b/winnet.c @@ -380,10 +380,10 @@ void sk_addrcopy(SockAddr addr, char *buf) #endif struct in_addr a; a.s_addr = htonl(addr->address); - strncpy(buf, (char*) &a.s_addr, 4); + memcpy(buf, (char*) &a.s_addr, 4); #ifdef IPV6 } else { - strncpy(buf, (char*) addr->ai, 16); + memcpy(buf, (char*) addr->ai, 16); } #endif }