process the scanf() output so Ubuntu 22 compiler doesn't error due to default warn_unused_result instead of Makefile -Wunused-result

This commit is contained in:
Michael E. Johnson 2023-03-16 16:18:12 -05:00
parent e750735216
commit 0660aeed69

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