Subject: Re: Adding /proc/swaps to linux compat code
To: Christian Biere <firstname.lastname@example.org>
From: David Laight <email@example.com>
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  snprintf() ever return -1 ?
Time to RTFM...
 the snprintf() implementation favoured by a common OS can return the
buffer length and fail to 0 terminate the output!
David Laight: firstname.lastname@example.org