summaryrefslogtreecommitdiffstats
path: root/libc/inet/ntop.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-10-22 00:41:29 -0400
committerAustin Foxley <austinf@cetoncorp.com>2009-11-09 15:43:02 -0800
commitfc88e8a6091ee0b8d238635fb5328f552741ccc9 (patch)
tree7549f3830d906fd480f1eb324ea1cbe298854219 /libc/inet/ntop.c
parenta128ed797f0075f7f33ce060edd889e59261b4fc (diff)
downloaduClibc-alpine-fc88e8a6091ee0b8d238635fb5328f552741ccc9.tar.bz2
uClibc-alpine-fc88e8a6091ee0b8d238635fb5328f552741ccc9.tar.xz
inet_ntop4: avoid inline initialization
We only need to set the first byte to 0, but gcc likes to zero out the rest of the string with memset() when using this initialization style. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/inet/ntop.c')
-rw-r--r--libc/inet/ntop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c
index 57a0b8ccd..fa733e0ad 100644
--- a/libc/inet/ntop.c
+++ b/libc/inet/ntop.c
@@ -51,10 +51,12 @@
static const char *
inet_ntop4(const u_char *src, char *dst, size_t size)
{
- char tmp[sizeof ("255.255.255.255") + 1] = "\0";
+ char tmp[sizeof ("255.255.255.255") + 1];
int octet;
int i;
+ tmp[0] = '\0';
+
i = 0;
for (octet = 0; octet <= 3; octet++) {