Re: [PATCH 2/4] Staging: most: fix snprintf() is printing too much

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Jul 2015 11:53:34 +0530
Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx> wrote:

> On Tue, Jul 28, 2015 at 05:16:09PM +0200, Christian Gromm wrote:
> > This patch prevents snprintf from exceeding a given buffer size.
> > 
> > Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> > Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
> > ---
> <snip>
> > -		snprintf(devnod_buf, PAGE_SIZE, "%s-%s", mdev, mdev_ch);
> > +		snprintf(devnod_buf, sizeof(devnod_buf), "%s-%s", mdev, mdev_ch);
> And this gives checkpatch warning for more than 80 char.

I know, but decided to keep it anyway for the sake of readabilty.
Thanks for pointing this out.

Regards
Chris

> 
> regards
> sudip

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux