Obviously not that trivial: The return type of sizeof() is size_t, which
is unsigned, thus the second conversion specification should be "%zu".
(The printf manpage notes that the "%zd" conversion "indicates that the
argument is of a signed type equivalent in size to a size_t.").

natano

On Mon, Feb 09, 2015 at 10:32:55PM -0600, Brent Cook wrote:
> Pretty trivial conversion. ok?
> 
> Index: ntp_msg.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ntpd/ntp_msg.c,v
> retrieving revision 1.20
> diff -u -p -u -p -r1.20 ntp_msg.c
> --- ntp_msg.c 9 Jan 2015 07:35:37 -0000       1.20
> +++ ntp_msg.c 10 Feb 2015 04:23:03 -0000
> @@ -62,7 +62,7 @@ ntp_sendmsg(int fd, struct sockaddr *sa,
>       }
> 
>       if (n != sizeof(*msg)) {
> -             log_warnx("ntp_sendmsg: only %ld of %ld bytes sent", n,
> +             log_warnx("ntp_sendmsg: only %zd of %zd bytes sent", n,
>                   sizeof(*msg));
>               return (-1);
>       }
> 

Reply via email to