> [How to use StrPrintF such that it can't overwrite the buffer]

One trick I've found useful: always follow a call to StrPrintF with an
assertion (in your debug build) that StrLen(buffer) < BUFFERSIZE.
Since StrPrintF will have written a null byte at the end, no matter
how much memory it's trashed, this will catch the problem unless
things are so screwed up that the assertion failure can't be reported.
I've caught a few nasty bugs running gremlins against my debug build
this way.

--Eric House

******************************************************************************
* From the desktop of: Eric House, [EMAIL PROTECTED]                            *
*     Check out Crosswords for PalmOS: <http://www.peak.org/~fixin/xwords>   *
*          "The instructions said 'Win98 or better' -- so I installed Linux" *
******************************************************************************

Reply via email to