mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
31 lines
498 B
C++
31 lines
498 B
C++
{
|
|
int i, j;
|
|
|
|
// BAD: The result is only checked against zero
|
|
if (scanf("%d %d", &i, &j)) {
|
|
use(i);
|
|
use(j);
|
|
}
|
|
|
|
// BAD: The result is only checked against zero
|
|
if (scanf("%d %d", &i, &j) == 0) {
|
|
i = 0;
|
|
j = 0;
|
|
}
|
|
use(i);
|
|
use(j);
|
|
|
|
if (scanf("%d %d", &i, &j) == 2) {
|
|
// GOOD: the result is checked against 2
|
|
}
|
|
|
|
// GOOD: the result is compared directly
|
|
int r = scanf("%d %d", &i, &j);
|
|
if (r < 2) {
|
|
return;
|
|
}
|
|
if (r == 1) {
|
|
j = 0;
|
|
}
|
|
}
|