From aa6111fc93c1cb5950e45ee3c8354e1e517b9524 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Tue, 31 Jul 2001 22:10:29 +0000 Subject: Add mysnprintf.c to Windows build, + squash compiler wngs in mysnprintf.c. --- Python/mysnprintf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Python/mysnprintf.c') diff --git a/Python/mysnprintf.c b/Python/mysnprintf.c index e6c3fcedc6..a373f4efe6 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; } -- cgit v1.2.1