diff options
Diffstat (limited to 'flags/simple.c')
-rw-r--r-- | flags/simple.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/flags/simple.c b/flags/simple.c new file mode 100644 index 0000000..e69e8e5 --- /dev/null +++ b/flags/simple.c @@ -0,0 +1,23 @@ +#include <fcntl.h> +#include <stdio.h> + +// this one is really simple +int main() { + int fd; + char buff[32]; + int len; + + fd = open("simple.not.the.flag", O_RDONLY); + if(-1 == fd) { + perror("open failed"); + return -1; + } + len = read(fd, buff, sizeof(buff)); + if(len < 0) { + perror("read failed"); + return -1; + } + write(1, buff, len); + putchar('\n'); + return 0; +} |