]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
authorVictor Stinner <vstinner@python.org>
Tue, 4 Aug 2020 00:38:16 +0000 (02:38 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2020 00:38:16 +0000 (02:38 +0200)
incr cannot be larger than INT_MAX: downcast to int explicitly.

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);