Skip to content

Commit 2af2331

Browse files
authored
Merge pull request antimatter15#3 from bigattichouse/master
process the scanf() output so Ubuntu 22 compiler doesn't error due to…
2 parents bf24462 + 0660aee commit 2af2331

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chat.cpp

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

0 commit comments

Comments
 (0)