On Thu, 9 Aug 2012, Marc Balmer wrote:
> When converting sprintf() to snprintf(), don't use the idiom
Applied (with a a minor first-line commit msg fix). Thanks!
[...]
--
Jon Trulson
"If the Martian rope-a-dope don't get him, he'll get himself, he'll
come in too fast and punch himself out."
When converting sprintf() to snprintf(), don't use the idiom
char foo[BUFSIZ];
snprintf(foo, BUFSIZ, );
but
char foo[BUFSIZ];
snprintf(foo, sizeo foo, );
because this will automatically catch situations where the size of foo
is later changed, e.g. like foo[BUFSIZ + 8];
The attached pa