1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-26 17:39:03 +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

@@ -2825,7 +2825,7 @@ const char *ippackethdrinfo(const u8 *packet, u32 len, int detail) {
case 4:
strcpy(icmptype, "Fragmentation required");
Snprintf(icmpfields, sizeof(icmpfields), "Next-Hop-MTU=%hu", icmppkt->data[2]<<8 | icmppkt->data[3]);
Snprintf(icmpfields, sizeof(icmpfields), "Next-Hop-MTU=%d", icmppkt->data[2]<<8 | icmppkt->data[3]);
break;
case 5: