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:
parent
e750735216
commit
0660aeed69
1 changed files with 1 additions and 1 deletions
2
chat.cpp
2
chat.cpp
|
@ -1035,7 +1035,7 @@ int main(int argc, char ** argv) {
|
||||||
if(params.use_color) printf(ANSI_BOLD ANSI_COLOR_GREEN);
|
if(params.use_color) printf(ANSI_BOLD ANSI_COLOR_GREEN);
|
||||||
if (scanf("%255[^\n]%n%*c", buf, &n_read) <= 0) {
|
if (scanf("%255[^\n]%n%*c", buf, &n_read) <= 0) {
|
||||||
// presumable empty line, consume the newline
|
// presumable empty line, consume the newline
|
||||||
scanf("%*c");
|
if (scanf("%*c") <= 0) { /*ignore*/ }
|
||||||
n_read=0;
|
n_read=0;
|
||||||
}
|
}
|
||||||
if(params.use_color) printf(ANSI_COLOR_RESET);
|
if(params.use_color) printf(ANSI_COLOR_RESET);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue