Re: [PATCH 1/2] Fix format overflows

From: Jonathan Dieter
Date: Tue Feb 21 2017 - 12:50:38 EST


On Tue, 2017-02-21 at 08:48 +0200, Jonathan Dieter wrote:
> On Tue, 2017-02-21 at 07:12 +0100, Krzysztof Opasiak wrote:
> > Hi,
> > Â
> > W dniu 2017-02-20 o 21:51, Jonathan Dieter pisze:Â
> > > + err("busid length %i >= SYSFS_BUS_ID_SIZE",
> > > size);
>
> Should I also change the error messages to use real values?
> Ex:
> err("busid length %i >= %i", size, sizeof(busid));

On further reflection, I do think changing the error messages to use
sizeof() is cleaner.

If you disagree, please let me know. I don't have a strong feeling
about it one way or the other.

The next revision uses sizeof() in the places you indicated and changes
size to an unsigned int since we're now comparing it to the result of
sizeof().

Thanks again,
Jonathan