diff Python/errors.c @ 11825:4080c7a0f1ed legacy-trunk

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.)
author Guido van Rossum <guido@python.org>
date Mon, 21 Feb 2000 16:50:31 +0000
parents fe960ad3db65
children 723efcdcce1b
line wrap: on
line diff
--- a/Python/errors.c	Mon Feb 21 11:07:37 2000 +0000
+++ b/Python/errors.c	Mon Feb 21 16:50:31 2000 +0000
@@ -308,7 +308,7 @@
 		   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 {