cppcheck/test/testsuites/x-flow/buffer04.cpp

19 lines
247 B
C++
Raw Normal View History

2019-12-15 13:57:27 +01:00
#include <stdlib.h>
// Nested loops
void f() {
char* buf = (char*) malloc(9);
int i, j;
for (i = 0; i < 3; i++) {
for (j = 0; j < 6; j++) {
buf[i*j] = 's';
}
}
}
int main() {
f();
return 0;
}