]> granicus.if.org Git - python/commitdiff
Fixed signed/unsigned comparison warning
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 15 Oct 2014 21:14:53 +0000 (23:14 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 15 Oct 2014 21:14:53 +0000 (23:14 +0200)
Objects/unicodeobject.c

index 8eb2dd2dc6b65d636f406b46b6611e384350f2cf..e896aba4ccd020d8a9b927c2bdbacc55aca86ed5 100644 (file)
@@ -9484,7 +9484,7 @@ case_operation(PyObject *self,
     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;
     }