svn commit: r228625 - head/usr.bin/csup

mdf at FreeBSD.org mdf at FreeBSD.org
Sat Dec 17 23:49:51 UTC 2011


On Sat, Dec 17, 2011 at 1:54 PM, Dimitry Andric <dim at freebsd.org> wrote:
> On 2011-12-17 22:32, mdf at FreeBSD.org wrote:
> ...
>>>  In usr.bin/csup/auth.c, use the correct number of bytes for zeroing the
>>>  shared secret, and use long long format to snprintf a time_t.
>> If casting is necessary, style prefers intmax_t or uintmax_t, since
>> those are always wide enough.
>
> I don't see anything about that in style(9), maybe it should be added
> then?

Probably; Bruce has mentioned it many times in the past, and as bz@
notes, it's a well-defined type with a well-defined conversion
specifier.  Also, long long is a bit of a hack that came in before C99
standardized on a few wider types, and the PRIu64 macros are really
hideous.

Thanks,
matthew

> In any case, I only changed the %ld format to %lld, because
> time_t is int, long or long long depending on arch.  Long long is just
> the widest type required in this case.
>


More information about the svn-src-all mailing list