From: Stefan Krah Date: Fri, 25 Aug 2017 18:12:05 +0000 (+0200) Subject: bpo-31279: Silence -Wstringop-overflow warning. (#3207) X-Git-Tag: v3.7.0a1~219 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dce6502059f46a04f90938b9d832394c8215397b;p=python bpo-31279: Silence -Wstringop-overflow warning. (#3207) --- diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 22dd810a7d..857a1aa070 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -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 {