diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/longobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index f7df699..abddbc4 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1834,7 +1834,8 @@ _PyLong_Format(PyObject *aa, int base) accumbits += PyLong_SHIFT; assert(accumbits >= bits); do { - Py_UNICODE cdigit = accum & (base - 1); + Py_UNICODE cdigit; + cdigit = (Py_UNICODE)(accum & (base - 1)); cdigit += (cdigit < 10) ? '0' : 'a'-10; assert(p > PyUnicode_AS_UNICODE(str)); *--p = cdigit; |