]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
PC/_subprocess.c: Fix signed/unsigned comparison (GH-7446)
authorVictor Stinner <vstinner@redhat.com>
Wed, 6 Jun 2018 11:10:41 +0000 (13:10 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Jun 2018 11:10:41 +0000 (13:10 +0200)
Fix the following compiler warning on Windows:
..\PC\_subprocess.c(384): warning C4018: '>' : signed/unsigned mismatch

PC/_subprocess.c

index fc9aaa461132cab47fe1edcecadaf340186174d8..66940ff7e4b838e56fc768fc73b8b019300a613e 100644 (file)
@@ -381,7 +381,7 @@ getenvironment(PyObject* environment)
         }
         totalsize = (p - PyString_AS_STRING(out)) + ksize + 1 +
                                                      vsize + 1 + 1;
-        if (totalsize > PyString_GET_SIZE(out)) {
+        if (totalsize > (size_t)PyString_GET_SIZE(out)) {
             size_t offset = p - PyString_AS_STRING(out);
             if (_PyString_Resize(&out, totalsize + 1024))
                 goto exit;