]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Argh. "integer" is a very confusing word ;)
authorGeorg Brandl <georg@python.org>
Thu, 8 Jun 2006 13:31:14 +0000 (13:31 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 8 Jun 2006 13:31:14 +0000 (13:31 +0000)
Actually, checking for INT_MAX and INT_MIN is correct since
the format code explicitly handles a C "int".
 (backport from rev. 46746)

Python/getargs.c

index be79b7516e320f31b6b9d79719acf5e26c8286e0..2d231ce14c34c42935239605fad99b078d87627a 100644 (file)
@@ -552,12 +552,12 @@ convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf,
                ival = PyInt_AsLong(arg);
                if (ival == -1 && PyErr_Occurred())
                        return converterr("integer<i>", arg, msgbuf, bufsize);
-               else if (ival > LONG_MAX) {
+               else if (ival > INT_MAX) {
                        PyErr_SetString(PyExc_OverflowError,
                                "signed integer is greater than maximum");
                        return converterr("integer<i>", arg, msgbuf, bufsize);
                }
-               else if (ival < LONG_MIN) {
+               else if (ival < INT_MIN) {
                        PyErr_SetString(PyExc_OverflowError,
                                "signed integer is less than minimum");
                        return converterr("integer<i>", arg, msgbuf, bufsize);