Re: [PATCH] Cleanup: snprintf() always NUL-terminates: depend on it

From: Giel van Schijndel
Date: Sun Jan 04 2015 - 18:05:53 EST


On Sun, Jan 04, 2015 at 19:05:58 +0100, Giel van Schijndel wrote:
> Especially since one very strange piece of code seems to be written in
> such a way that a NUL needs to be placed where a NUL is present already.
> The author probably meant to fill the last byte of the buffer with a NUL
> instead. But regardless of that: that isn't necessary since snprintf()
> already guarantees NUL termination for buffers sizes > 0 and <= INT_MAX.
> ---

Forgot to:
Signed-off-by: Giel van Schijndel <me@xxxxxxxxx>

--
Met vriendelijke groet,
With kind regards,
Giel van Schijndel
--
Of course I talk to myself. Sometimes I need expert advice.

Attachment: signature.asc
Description: Digital signature