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:
commit
2af2331add
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 (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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue