1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Fix these compiler warnings with a patch from Solar Designer:

ncat_proxy.c: In function `ncat_http_server':
ncat_proxy.c:163: warning: dereferencing type-punned pointer will break strict-aliasing rules

nmap_dns.cc: In function `void parse_resolvdotconf()':
nmap_dns.cc:951: warning: unsigned int format, different type arg (arg 4)

traceroute.cc: In member function `void TracerouteState::read_replies(long int)':
traceroute.cc:1031: warning: 'header_len' might be used uninitialized in this function
This commit is contained in:
david
2010-01-28 18:55:08 +00:00
parent 9f9ce26425
commit 0ed416b8fd
2 changed files with 3 additions and 1 deletions

View File

@@ -947,7 +947,7 @@ static void parse_resolvdotconf() {
}
/* Customize a sscanf format to sizeof(ipaddr). */
Snprintf(fmt, sizeof(fmt), "nameserver %%%us", sizeof(ipaddr));
Snprintf(fmt, sizeof(fmt), "nameserver %%%us", (unsigned int) sizeof(ipaddr));
while (fgets(buf, sizeof(buf), fp)) {
tp = buf;

View File

@@ -122,10 +122,12 @@ extern "C" {
#endif
void fatal(const char *fmt, ...)
__attribute__ ((noreturn))
__attribute__ ((format (printf, 1, 2)));
void error(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
void pfatal(const char *err, ...)
__attribute__ ((noreturn))
__attribute__ ((format (printf, 1, 2)));
void gh_perror(const char *err, ...)
__attribute__ ((format (printf, 1, 2)));