Subject: Re: Adding /proc/swaps to linux compat code
To: Christian Biere <christianbiere@gmx.de>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 02/01/2007 22:03:10
On Thu, Feb 01, 2007 at 12:11:36AM +0100, Christian Biere wrote:
> Arnaud Lacombe wrote:
> > A first patch is available here:
> > http://www.sigfpe.info/netbsd/proc_swaps.diff
> 
>  * You should check the return value of snprintf() with "<= 0" instead of "== 0".
>    At least when remaining reached zero, snprintf() will return -1 and not 0.

Will it? Does a conformant [1] snprintf() ever return -1 ?
Time to RTFM...

	David

[1] the snprintf() implementation favoured by a common OS can return the
buffer length and fail to 0 terminate the output!

-- 
David Laight: david@l8s.co.uk