Merge pull request #3 from bigattichouse/master

process the scanf() output so Ubuntu 22 compiler doesn't error due to…
This commit is contained in:
Kevin Kwok 2023-03-16 18:30:17 -07:00 committed by GitHub
commit 2af2331add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1035,7 +1035,7 @@ int main(int argc, char ** argv) {
if(params.use_color) printf(ANSI_BOLD ANSI_COLOR_GREEN);
if (scanf("%255[^\n]%n%*c", buf, &n_read) <= 0) {
// presumable empty line, consume the newline
scanf("%*c");
if (scanf("%*c") <= 0) { /*ignore*/ }
n_read=0;
}
if(params.use_color) printf(ANSI_COLOR_RESET);