From 982c1f2697f6051be22dfaf9311c6ab3eae44f91 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 8 Jan 2007 16:30:10 -0800 Subject: [PATCH] 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. --- tftpd/tftpd.c | 3 +-- 1 file changed, 1 insertion(+), 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: -- 2.11.4.GIT