]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Fix a warning about the type of sizeof as expected by printf
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 25 Jan 2011 21:07:55 +0000 (21:07 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 25 Jan 2011 21:07:55 +0000 (21:07 +0000)
The size returned by sizeof should fit easily in a int. No need to use
the more standard %zu that may not be portable to other less
compatible systems.

ip2name.c

index 280a95301f6da5b0ed8e6e72fe4ed94ba41763bf..f9d78c7bb29bf7948c046aabd847ca22edcfb6e4 100644 (file)
--- a/ip2name.c
+++ b/ip2name.c
@@ -114,7 +114,7 @@ void name2ip(char *name,int name_size)
                struct sockaddr_in *s4=(struct sockaddr_in *)res->ai_addr;
                struct in_addr *sa=&s4->sin_addr;
                if (res->ai_addrlen<sizeof(*s4)) {
-                       debuga(_("Short structure returned by getaddrinfo for an IPv4 address: %d bytes instead of %d\n"),res->ai_addrlen,sizeof(*s4));
+                       debuga(_("Short structure returned by getaddrinfo for an IPv4 address: %d bytes instead of %d\n"),res->ai_addrlen,(int)sizeof(*s4));
                        exit(EXIT_FAILURE);
                }
                inet_ntop(res->ai_family,sa,name,name_size);
@@ -122,7 +122,7 @@ void name2ip(char *name,int name_size)
                struct sockaddr_in6 *s6=(struct sockaddr_in6 *)res->ai_addr;
                struct in6_addr *sa6=&s6->sin6_addr;
                if (res->ai_addrlen<sizeof(*s6)) {
-                       debuga(_("Short structure returned by getaddrinfo for an IPv6 address: %d bytes instead of %d\n"),res->ai_addrlen,sizeof(*s6));
+                       debuga(_("Short structure returned by getaddrinfo for an IPv6 address: %d bytes instead of %d\n"),res->ai_addrlen,(int)sizeof(*s6));
                        exit(EXIT_FAILURE);
                }
                inet_ntop(res->ai_family,sa6,name,name_size);