From: Rob Browning Date: Fri, 21 Mar 2014 20:13:27 +0000 (-0500) Subject: _helpers.c: use "unsigned long long" in ASSIGN_PYLONG_TO_INTEGRAL(). X-Git-Tag: 0.26-rc1~28 X-Git-Url: https://arthur.barton.de/gitweb/?p=bup.git;a=commitdiff_plain;h=4289be0a394ef4d4008d38a688b31ade02e9d753 _helpers.c: use "unsigned long long" in ASSIGN_PYLONG_TO_INTEGRAL(). The result of PyLong_AsUnsignedLongLong() was being assigned to an "unsigned long". Don't do that. Thanks to Alexander Barton for reporting the problem. Signed-off-by: Rob Browning --- diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index 2af13bb..b9b050b 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -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; \