Skip to content

Commit

Permalink
Comment about a bug of codeQL
Browse files Browse the repository at this point in the history
Where should I report this?
  • Loading branch information
mm2 committed Jan 23, 2024
1 parent d19ac19 commit d2f5a15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/transicc/transicc.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,9 @@ void GetLine(char* Buffer, const char* frm, ...)
vfprintf(stderr, frm, args);

res = scanf("%4095s", Buffer);

// An amazing bug of codeQL here. It reports:
// 'The result of scanf is only checked against 0, but it can also return EOF."
// Not only is not compared against zero, it happens that C99 requires EOF to be negative!
if (res < 0 || toupper(Buffer[0]) == 'Q') { // Quit?

CloseTransforms();
Expand Down

0 comments on commit d2f5a15

Please sign in to comment.