summaryrefslogtreecommitdiff
path: root/lib/inet_ntop.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-04-29 15:46:40 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-04-29 22:32:49 +0200
commit4f45240bc84a9aa648c8f7243be7b79e9f9323a5 (patch)
tree975f7e1e617df32c42db93cf0cbacfd10ff640c4 /lib/inet_ntop.c
parent63b5378a617437859da1e7ab5553d36eb83bdd44 (diff)
downloadcurl-4f45240bc84a9aa648c8f7243be7b79e9f9323a5.tar.gz
lib: include curl_printf.h as one of the last headers
curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743
Diffstat (limited to 'lib/inet_ntop.c')
-rw-r--r--lib/inet_ntop.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index da9a3ab43..416005c03 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -32,9 +32,8 @@
#include <arpa/inet.h>
#endif
-#include "curl_printf.h"
-
#include "inet_ntop.h"
+#include "curl_printf.h"
#define IN6ADDRSZ 16
#define INADDRSZ 4
@@ -57,10 +56,10 @@ static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size)
tmp[0] = '\0';
(void)snprintf(tmp, sizeof(tmp), "%d.%d.%d.%d",
- ((int)((unsigned char)src[0])) & 0xff,
- ((int)((unsigned char)src[1])) & 0xff,
- ((int)((unsigned char)src[2])) & 0xff,
- ((int)((unsigned char)src[3])) & 0xff);
+ ((int)((unsigned char)src[0])) & 0xff,
+ ((int)((unsigned char)src[1])) & 0xff,
+ ((int)((unsigned char)src[2])) & 0xff,
+ ((int)((unsigned char)src[3])) & 0xff);
len = strlen(tmp);
if(len == 0 || len >= size) {