]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
unicodeobject.c: fix a compiler warning on Windows 64 bits
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 25 Jul 2014 12:03:03 +0000 (14:03 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 25 Jul 2014 12:03:03 +0000 (14:03 +0200)
Objects/unicodeobject.c

index 8f6cc9e0b34db3bd99c6fb67bf82c9ebc18f128d..72272c70528b65b856553e7d51c2911c8ceb06bd 100644 (file)
@@ -7015,7 +7015,8 @@ decode_code_page_errors(UINT code_page,
     assert(outsize <= PyUnicode_WSTR_LENGTH(*v));
     if (unicode_resize(v, outsize) < 0)
         goto error;
-    ret = in - startin;
+    /* (in - startin) <= size and size is an int */
+    ret = Py_SAFE_DOWNCAST(in - startin, Py_ssize_t, int);
 
 error:
     Py_XDECREF(encoding_obj);