bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)

incr cannot be larger than INT_MAX: downcast to int explicitly.
This commit is contained in:
Victor Stinner 2020-08-04 02:38:16 +02:00 committed by GitHub
parent 701b63894f
commit bde48fd811
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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