[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
nico.rieck at gmail.com
Tue Jul 23 10:10:54 PDT 2013
On 23.07.2013 18:55, Reid Kleckner wrote:
> Please don't assume snprintf always null terminates.
I'm reading C99 18.104.22.168 and C11 22.214.171.124 which says:
"If n is zero, nothing is written, and s may be a null pointer.
Otherwise, output characters beyond the n-1st are discarded rather
than being written to the array, and a null character is written at the
end of the characters actually written into the array."
and "Thus, the null-terminated output has been
completely written if and only if the returned value is nonnegative and
less than n."
More information about the llvm-dev