Files
ctf/2025/cscg/web/canteenfood/readflag.c
2025-06-06 03:13:31 +02:00

17 lines
268 B
C

#include <stdio.h>
int main(void) {
char flag[256] = {0};
FILE* fp = fopen("/flag.txt", "r");
if (!fp) {
perror("fopen");
return 1;
}
if (fread(flag, 1, 256, fp) < 0) {
perror("fread");
return 1;
}
puts(flag);
fclose(fp);
return 0;
}