]> arthur.barton.de Git - bup.git/commitdiff
_helpers.c: use "unsigned long long" in ASSIGN_PYLONG_TO_INTEGRAL().
authorRob Browning <rlb@defaultvalue.org>
Fri, 21 Mar 2014 20:13:27 +0000 (15:13 -0500)
committerRob Browning <rlb@defaultvalue.org>
Fri, 21 Mar 2014 20:13:29 +0000 (15:13 -0500)
The result of PyLong_AsUnsignedLongLong() was being assigned to an
"unsigned long".  Don't do that.

Thanks to Alexander Barton <alex@barton.de> for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/_helpers.c

index 2af13bb27d595e17aa5786cf18b96e0a2f049d10..b9b050bad10a2a40ad6de1289380628e69324853 100644 (file)
@@ -903,13 +903,13 @@ static PyObject *bup_set_linux_file_attr(PyObject *self, PyObject *args)
     ({                                                     \
         int result = 0;                                                 \
         *(overflow) = 0;                                                \
-        const long long ltmp = PyLong_AsLongLong(pylong);               \
-        if (ltmp == -1 && PyErr_Occurred())                             \
+        const long long lltmp = PyLong_AsLongLong(pylong);              \
+        if (lltmp == -1 && PyErr_Occurred())                            \
         {                                                               \
             if (PyErr_ExceptionMatches(PyExc_OverflowError))            \
             {                                                           \
-                const unsigned long ultmp = PyLong_AsUnsignedLongLong(pylong); \
-                if (ultmp == (unsigned long long) -1 && PyErr_Occurred()) \
+                const unsigned long long ulltmp = PyLong_AsUnsignedLongLong(pylong); \
+                if (ulltmp == (unsigned long long) -1 && PyErr_Occurred()) \
                 {                                                       \
                     if (PyErr_ExceptionMatches(PyExc_OverflowError))    \
                     {                                                   \
@@ -917,7 +917,7 @@ static PyObject *bup_set_linux_file_attr(PyObject *self, PyObject *args)
                         *(overflow) = 1;                                \
                     }                                                   \
                 }                                                       \
-                if (INTEGRAL_ASSIGNMENT_FITS((dest), ultmp))            \
+                if (INTEGRAL_ASSIGNMENT_FITS((dest), ulltmp))           \
                     result = 1;                                         \
                 else                                                    \
                     *(overflow) = 1;                                    \
@@ -925,7 +925,7 @@ static PyObject *bup_set_linux_file_attr(PyObject *self, PyObject *args)
         }                                                               \
         else                                                            \
         {                                                               \
-            if (INTEGRAL_ASSIGNMENT_FITS((dest), ltmp))                 \
+            if (INTEGRAL_ASSIGNMENT_FITS((dest), lltmp))                \
                 result = 1;                                             \
             else                                                        \
                 *(overflow) = 1;                                        \