summaryrefslogtreecommitdiff
path: root/Python/mysnprintf.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-07-31 22:10:29 +0000
committerTim Peters <tim.peters@gmail.com>2001-07-31 22:10:29 +0000
commit2b4909824c61c30996b50d81a37062e9ee22ec2a (patch)
tree0edfa490889aecfbe60f3c89e228d472cb5d8554 /Python/mysnprintf.c
parentd31bf2ffccecf515c335a65fac88fa9de013cc35 (diff)
downloadcpython-2b4909824c61c30996b50d81a37062e9ee22ec2a.tar.gz
Add mysnprintf.c to Windows build, + squash compiler wngs in mysnprintf.c.
Diffstat (limited to 'Python/mysnprintf.c')
-rw-r--r--Python/mysnprintf.c5
1 files changed, 3 insertions, 2 deletions
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;
}