> Another small bug in that code is that arguments or even fmt might
> actually end with a valid \0 byte that should be appended and counted
> (not a c-string terminating byte).
>
> This check should be done once, with controlled fmt and arguments so
> that we can detect problems reliably. You can do that at module
> initialization time, for example (./configure might be too early because
> libraries might change) and set a static SnprintfCountsTerminator
> variable accordingly.
>
> char buf[16];
> SprintfCountsTerminator = snprintf(buf, sizeof(buf), "%s", "1") == 2;
Clever!
Done.
-- /kinkieReceived on Thu Aug 01 2013 - 09:08:39 MDT
This archive was generated by hypermail 2.2.0 : Thu Aug 01 2013 - 12:00:51 MDT