]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 4 Aug 2020 00:56:54 +0000 (17:56 -0700)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2020 00:56:54 +0000 (17:56 -0700)
incr cannot be larger than INT_MAX: downcast to int explicitly.
(cherry picked from commit bde48fd8110cc5f128d5db44810d17811e328a24)

Co-authored-by: Victor Stinner <vstinner@python.org>
Parser/myreadline.c

index a49c9d892dda9e300ecc43f7958252867a8fb46a..143b41f1eab95ebfa3485953ee4eebea110c7c95 100644 (file)
@@ -317,7 +317,7 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
             return NULL;
         }
         p = pr;
-        int err = my_fgets(tstate, p + n, incr, sys_stdin);
+        int err = my_fgets(tstate, p + n, (int)incr, sys_stdin);
         if (err == 1) {
             // Interrupt
             PyMem_RawFree(p);