diff options
author | Guido van Rossum <guido@python.org> | 2000-02-21 16:50:31 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-02-21 16:50:31 (GMT) |
commit | 584b16a1f340b086526773ec3275589468ae4b04 (patch) | |
tree | c0801004432bbf1e88d9a3293c5f32dbbf718519 /Python | |
parent | 957d07a159b2ec68a1aec9ad8cb1ffbd3c43ba63 (diff) | |
download | cpython-584b16a1f340b086526773ec3275589468ae4b04.zip cpython-584b16a1f340b086526773ec3275589468ae4b04.tar.gz cpython-584b16a1f340b086526773ec3275589468ae4b04.tar.bz2 |
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.)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/errors.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index 71e51c3..b3e1910 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -308,7 +308,7 @@ PyErr_SetFromErrnoWithFilename(exc, filename) table, we use it, otherwise we assume it really _is_ a Win32 error code */ - if (i < _sys_nerr) { + if (i > 0 && i < _sys_nerr) { s = _sys_errlist[i]; } else { |