Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 9, 2008 at 1:16 PM, Justin Ferguson <[EMAIL PROTECTED]> wrote: .. > That said, theres plenty of other implementations that manage this > without the potential of underflowing a buffer >
Do you have in mind something like the following? =================================================================== --- Python/mysnprintf.c (revision 62211) +++ Python/mysnprintf.c (working copy) @@ -88,6 +88,7 @@ PyMem_FREE(buffer); Done: #endif - str[size-1] = '\0'; + if (size > 0) + str[size-1] = '\0'; return len; } I would be +0 on such change. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2588> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com