Skip to content

Commit

Permalink
Add mysnprintf.c to Windows build, + squash compiler wngs in mysnprin…
Browse files Browse the repository at this point in the history
…tf.c.
  • Loading branch information
tim-one committed Jul 31, 2001
1 parent 03d1b18 commit aa6111f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 15 additions & 0 deletions PCbuild/pythoncore.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Python/mysnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit aa6111f

Please sign in to comment.