]> granicus.if.org Git - python/commitdiff
bpo-31279: Silence -Wstringop-overflow warning. (#3207)
authorStefan Krah <skrah@bytereef.org>
Fri, 25 Aug 2017 18:12:05 +0000 (20:12 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Aug 2017 18:12:05 +0000 (20:12 +0200)
Objects/bytearrayobject.c

index 22dd810a7dd88d082c7e5a212f17b448beee28c8..857a1aa070eeb08ec331131c63539db75990a873 100644 (file)
@@ -224,7 +224,7 @@ PyByteArray_Resize(PyObject *self, Py_ssize_t requested_size)
             return -1;
         }
         memcpy(sval, PyByteArray_AS_STRING(self),
-               Py_MIN(requested_size, Py_SIZE(self)));
+               Py_MIN((size_t)requested_size, (size_t)Py_SIZE(self)));
         PyObject_Free(obj->ob_bytes);
     }
     else {