summaryrefslogtreecommitdiff
path: root/inet_ntop.c
diff options
context:
space:
mode:
Diffstat (limited to 'inet_ntop.c')
-rw-r--r--inet_ntop.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/inet_ntop.c b/inet_ntop.c
index 6de0a6d..07d3f5a 100644
--- a/inet_ntop.c
+++ b/inet_ntop.c
@@ -48,12 +48,6 @@
#ifndef HAVE_INET_NTOP
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
/*
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
@@ -107,7 +101,7 @@ inet_ntop4(const unsigned char *src, char *dst, size_t size)
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof("255.255.255.255")];
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) >= size) {
+ if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) {
SET_ERRNO(ENOSPC);
return (NULL);
}
@@ -194,7 +188,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
tp += strlen(tp);
break;
}
- tp += SPRINTF((tp, "%x", words[i]));
+ tp += sprintf(tp, "%x", words[i]);
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) ==