Re: logger: correct snprintf usage

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

 



LaMont Jones wrote:
> On Sat, Jul 28, 2007 at 10:41:37PM -0600, LaMont Jones wrote:
>> snprintf doesn't write the trailing null to the buffer in the case of
>> truncation.  The following patch fixes logger.c the rest of the way.
> 
> Sigh... here is a properly formatted patch (that actually compiles and
> is tested, too.)

snprintf does always NUL terminate.
Have a look at the second point here:
http://www.pixelbeat.org/programming/c_c++_notes.html

thanks,
Pádraig.
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux