forked from mirrors/tftp-hpa-google
printf() and htonl() type matching issue
On older systems, htonl() returns unsigned long, on newer systems it returns uint32_t. Cast to unsigned long and use %08lX for the format, that seems to be the easiest solution.
This commit is contained in:
parent
ab12c128ff
commit
982c1f2697
1 changed files with 1 additions and 2 deletions
|
@ -1046,8 +1046,7 @@ rewrite_macros(char macro, char *output)
|
|||
|
||||
case 'x':
|
||||
if ( output )
|
||||
sprintf(output, "%08X",
|
||||
ntohl(from.sin_addr.s_addr));
|
||||
sprintf(output, "%08lX", (unsigned long)ntohl(from.sin_addr.s_addr));
|
||||
return 8;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue