Commit 584b16a1 authored by Guido van Rossum's avatar Guido van Rossum

Mark pointed out a buglet in his patch: i < _sys_nerr isn't strong

enough, it could be negative.  Add i > 0 test.  (Not i >= 0; zero isn't
a valid error number.)
parent 957d07a1
...@@ -308,7 +308,7 @@ PyErr_SetFromErrnoWithFilename(exc, filename) ...@@ -308,7 +308,7 @@ PyErr_SetFromErrnoWithFilename(exc, filename)
table, we use it, otherwise we assume it really _is_ table, we use it, otherwise we assume it really _is_
a Win32 error code a Win32 error code
*/ */
if (i < _sys_nerr) { if (i > 0 && i < _sys_nerr) {
s = _sys_errlist[i]; s = _sys_errlist[i];
} }
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment