Skip to content

Commit b8c2c84

Browse files
author
tim_one
committed
Add mysnprintf.c to Windows build, + squash compiler wngs in mysnprintf.c.
git-svn-id: http://svn.python.org/projects/python/trunk@22115 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 9a1994d commit b8c2c84

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

PCbuild/pythoncore.dsp

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/mysnprintf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ int myvsnprintf(char *str, size_t size, const char *format, va_list va)
3737
return len;
3838
}
3939
len++;
40-
if (len > size + 512)
40+
assert(len >= 0);
41+
if ((size_t)len > size + 512)
4142
Py_FatalError("Buffer overflow in PyOS_snprintf/PyOS_vsnprintf");
42-
if (len > size) {
43+
if ((size_t)len > size) {
4344
PyMem_Free(buffer);
4445
return len - 1;
4546
}

0 commit comments

Comments
 (0)