[Python-checkins] cpython: Fixed signed/unsigned comparison warning

antoine.pitrou python-checkins at python.org
Wed Oct 15 23:15:22 CEST 2014


https://hg.python.org/cpython/rev/030fda7b1de8
changeset:   93085:030fda7b1de8
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Oct 15 23:14:53 2014 +0200
summary:
  Fixed signed/unsigned comparison warning

files:
  Objects/unicodeobject.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -9675,7 +9675,7 @@
     kind = PyUnicode_KIND(self);
     data = PyUnicode_DATA(self);
     length = PyUnicode_GET_LENGTH(self);
-    if (length > PY_SSIZE_T_MAX / (3 * sizeof(Py_UCS4))) {
+    if ((size_t) length > PY_SSIZE_T_MAX / (3 * sizeof(Py_UCS4))) {
         PyErr_SetString(PyExc_OverflowError, "string is too long");
         return NULL;
     }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list