]> 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:59:02 +0000 (17:59 -0700)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2020 00:59:02 +0000 (17:59 -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 29b254f771f16c98dcaa0614496bddbe343ca091..e8e57738f3377fbbc77c5587a96c279551125b36 100644 (file)
@@ -318,7 +318,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);