Re: [cdesktopenv-devel] use sizeof when converting from sprintf() to snprintf()

2012-08-09 Thread Jon Trulson
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."

[cdesktopenv-devel] use sizeof when converting from sprintf() to snprintf()

2012-08-08 Thread Marc Balmer
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