diff options
author | Guido van Rossum <guido@python.org> | 2000-02-21 16:50:31 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-02-21 16:50:31 +0000 |
commit | 2fd6bf4a410699c425aff91816f039b5bcd30d55 (patch) | |
tree | 264e1f77ee1db54676893703f8c346b880a4914c /Python/errors.c | |
parent | 5141f3c655297e6ddfa2f3289e899c3564f05f15 (diff) | |
download | cpython-2fd6bf4a410699c425aff91816f039b5bcd30d55.tar.gz |
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/errors.c')
-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 71e51c3023..b3e1910789 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 { |