[PATCH 12/16] Staging: quickstart: Use list.h API for buttons list

Dan Carpenter dan.carpenter at oracle.com
Wed Jan 11 11:47:40 UTC 2012


On Mon, Jan 09, 2012 at 11:23:31PM +0100, Szymon Janc wrote:
> +	list_for_each_entry(b, &buttons, list) {
> +		count += snprintf(buf + count, PAGE_SIZE - count, "%d\t%s\n",
> +							b->id, b->name);
> +
> +		if (count == PAGE_SIZE)

snprintf() returns the number of bytes which would have been used if
there were space so this test should be >= instead of ==.

> +			break;
>  	}

regards,
dan carpenter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20120111/239f7453/attachment.asc>


More information about the devel mailing list