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

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2020-08-03 17:59:02 -07:00 committed by GitHub
parent b934d832d1
commit 46e448abbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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