]> 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 cc36e7ae876bf0b005e094084a5822e7eb5b8503..898b20d24bdbe682d5213c9cdfd60341a5e1fa85 100644 (file)
@@ -9675,7 +9675,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;
     }