Write MissingCheckScanf.qhelp

This commit is contained in:
Nora Dimitrijević
2022-08-24 19:58:19 +02:00
parent ca162a4365
commit 170d12bf5a
4 changed files with 76 additions and 7 deletions

View File

@@ -222,11 +222,11 @@ int main()
if (maybe()) {
break;
}
else if (maybe() && (scanf("%5c %d", c, &d) == 1)) { // GOOD [FALSE POSITIVE]
else if (maybe() && (scanf("%5c %d", c, &d) == 1)) { // GOOD
use(*(int *)c); // GOOD
use(d); // BAD
}
else if ((scanf("%5c %d", c, &d) == 1) && maybe()) { // GOOD [FALSE POSITIVE]
else if ((scanf("%5c %d", c, &d) == 1) && maybe()) { // GOOD
use(*(int *)c); // GOOD
use(d); // BAD
}