bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
incr cannot be larger than INT_MAX: downcast to int explicitly.
(cherry picked from commit bde48fd8110cc5f128d5db44810d17811e328a24)
Co-authored-by: Victor Stinner <vstinner@python.org>
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index a49c9d8..143b41f 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -317,7 +317,7 @@
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);