diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-01-08 16:30:10 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-01-08 16:30:10 -0800 |
commit | 982c1f2697f6051be22dfaf9311c6ab3eae44f91 (patch) | |
tree | cfa6177c41f91b078bb3b5fa2d7ab630b9badb05 | |
parent | ab12c128ff11db82d7865a99b6ab994cbcb95249 (diff) | |
download | tftp-hpa-982c1f2697f6051be22dfaf9311c6ab3eae44f91.tar.gz |
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.
-rw-r--r-- | tftpd/tftpd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index 8ea41d5..7e0d1f0 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -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: |