dhcp: Use correct format specifiers in a message
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Fri, 30 Jan 2015 10:54:39 +0000 (12:54 +0200)
committerNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Fri, 30 Jan 2015 16:16:32 +0000 (18:16 +0200)
Format size_t with %zu specifier, instead of %d, as size_t is not
guaranteed to be the same size as int.

This fixes the following compiler warnings:

freeradius-server-2.2.6/src/lib/dhcp.c: scope_hint: In function 'fr_dhcp_add_arp_entry'
freeradius-server-2.2.6/src/lib/dhcp.c:1536: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
freeradius-server-2.2.6/src/lib/dhcp.c:1536: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

src/lib/dhcp.c

index 9af6a5f..8a3c36d 100644 (file)
@@ -1530,8 +1530,8 @@ int fr_dhcp_add_arp_entry(int fd, const char *interface,
        }
 
        if (macaddr->length > sizeof (req.arp_ha.sa_data)) {
-               fr_strerror_printf("ERROR: DHCP only supports up to %d octets for "
-                                  "Client Hardware Address (got %d octets)\n",
+               fr_strerror_printf("ERROR: DHCP only supports up to %zu octets for "
+                                  "Client Hardware Address (got %zu octets)\n",
                                   sizeof(req.arp_ha.sa_data),
                                   macaddr->length);
                return -1;