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

Correct format string specifiers

The formats has been tested and verified on Mac OS X 10.8.5,
Mac OS X 10.11.5 and Ubuntu 14.04 LTS, all on x86_64 machines
and OSs. It mainly silences warnings. There were no warnings on
Ubuntu but a few on Mac OS, so the fix is intended to silence
warnings on Mac OS whithout triggering new warnings on other OSs.
Example of warnings previously encountered:

netutil.cc:2828:74: warning: format specifies type 'unsigned short'
but the argument has type 'int' [-Wformat]
This commit is contained in:
vincent
2016-07-01 11:44:26 +00:00
parent 9703feace9
commit 0f22680426
6 changed files with 12 additions and 12 deletions

View File

@@ -1269,7 +1269,7 @@ int readtcppacket(const u8 *packet, int readdata) {
log_write(LOG_PLAIN, "URG ");
log_write(LOG_PLAIN, "\n");
log_write(LOG_PLAIN, "ipid: %hu ttl: %hu ", ntohs(ip->ip_id),
log_write(LOG_PLAIN, "ipid: %hu ttl: %hhu ", ntohs(ip->ip_id),
ip->ip_ttl);
if (tcp->th_flags & (TH_SYN | TH_ACK))
@@ -1329,7 +1329,7 @@ int readudppacket(const u8 *packet, int readdata) {
sourcehost, ntohs(udp->uh_sport), inet_ntoa(bullshit2),
ntohs(udp->uh_dport), tot_len);
log_write(LOG_PLAIN, "ttl: %hu ", ip->ip_ttl);
log_write(LOG_PLAIN, "ttl: %hhu ", ip->ip_ttl);
}
}
if (readdata && i < tot_len) {