]> granicus.if.org Git - python/commitdiff
Mark pointed out a buglet in his patch: i < _sys_nerr isn't strong
authorGuido van Rossum <guido@python.org>
Mon, 21 Feb 2000 16:50:31 +0000 (16:50 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 21 Feb 2000 16:50:31 +0000 (16:50 +0000)
enough, it could be negative.  Add i > 0 test.  (Not i >= 0; zero isn't
a valid error number.)

Python/errors.c

index 71e51c30233e6673a3752f52bf7f1d6dea969c83..b3e19107895a6a8b242353edd548b7c7b3528de0 100644 (file)
@@ -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 {