mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-02-24 22:37:39 +05:30
freadln.c: add flushing of STDOUT
This commit is contained in:
parent
692eb05bf5
commit
139afe969b
@ -30,6 +30,10 @@ ssize_t freadln(char** output, size_t* length_out) {
|
|||||||
if (output == NULL)
|
if (output == NULL)
|
||||||
return freadln_ERROR;
|
return freadln_ERROR;
|
||||||
|
|
||||||
|
// NOTE: if the file is STDIN, flush STDOUT before waiting for input to
|
||||||
|
// make sure a prompt is displayed
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
freadln_length_type length = 0;
|
freadln_length_type length = 0;
|
||||||
|
|
||||||
*output = malloc((length + 1) * sizeof(char));
|
*output = malloc((length + 1) * sizeof(char));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user