diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-07-31 22:10:29 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-07-31 22:10:29 (GMT) |
commit | aa6111fc93c1cb5950e45ee3c8354e1e517b9524 (patch) | |
tree | 4c31cb2b727bc2a91ea83532fcd2d5540851c674 /Python/mysnprintf.c | |
parent | 03d1b1814b367baf8a52389b5a7d7805dba1f68a (diff) | |
download | cpython-aa6111fc93c1cb5950e45ee3c8354e1e517b9524.zip cpython-aa6111fc93c1cb5950e45ee3c8354e1e517b9524.tar.gz cpython-aa6111fc93c1cb5950e45ee3c8354e1e517b9524.tar.bz2 |
Add mysnprintf.c to Windows build, + squash compiler wngs in mysnprintf.c.
Diffstat (limited to 'Python/mysnprintf.c')
-rw-r--r-- | Python/mysnprintf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/mysnprintf.c b/Python/mysnprintf.c index e6c3fce..a373f4e 100644 --- a/Python/mysnprintf.c +++ b/Python/mysnprintf.c @@ -37,9 +37,10 @@ int myvsnprintf(char *str, size_t size, const char *format, va_list va) return len; } len++; - if (len > size + 512) + assert(len >= 0); + if ((size_t)len > size + 512) Py_FatalError("Buffer overflow in PyOS_snprintf/PyOS_vsnprintf"); - if (len > size) { + if ((size_t)len > size) { PyMem_Free(buffer); return len - 1; } |