]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-115391: Fix compiler warning in `Objects/longobject.c` (GH-115368)
authorKirill Podoprigora <kirill.bast9@mail.ru>
Tue, 13 Feb 2024 20:49:13 +0000 (23:49 +0300)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2024 20:49:13 +0000 (20:49 +0000)
Objects/longobject.c

index 932111f58425f227e0e8acf52edcf2829ae6bc9b..fe78298333432364ebd7f84e573c212519743065 100644 (file)
@@ -1135,7 +1135,7 @@ PyLong_AsNativeBytes(PyObject* vv, void* buffer, Py_ssize_t n, int endianness)
         if (n <= 0) {
             // nothing to do!
         }
-        else if (n <= sizeof(cv.b)) {
+        else if (n <= (Py_ssize_t)sizeof(cv.b)) {
 #if PY_LITTLE_ENDIAN
             if (little_endian) {
                 memcpy(buffer, cv.b, n);