#include <stdio>
int main() {
char a[12];
int b = scanf("%11s", a);
if (b != 1) { return 0; };
if (printf("%s", a) != 11) {
return 0;
};
return 0;
}
1 – are scanf
and printf
here used safely ?
2 – am i missing some checks ? i wanna make 100% bug free code in c
3 – is the only issue in scanf buffer overflow ? is it fixed in the above code ?
the purpose of all this is to make a c 100% safe code