why tcc allows stdlib to mutate constant value?
bokunodev opened this issue · 0 comments
bokunodev commented
this code is totally wrong. but its run anyway.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[]) {
char *line; //= calloc(1 << 20, sizeof(char));
FILE *f = fopen("input", "r");
for (int i = 0; i < 11; i++) {
line = fgets("\r\n", 1 << 20, f);
if (!line) {
break;
}
printf("%s line", line);
}
return 0;
}