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:
H. Peter Anvin 2007-01-08 16:30:10 -08:00
parent ab12c128ff
commit 982c1f2697

View file

@ -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: