diff options
Diffstat (limited to 'std')
| -rw-r--r-- | std/stdio.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/std/stdio.c b/std/stdio.c index e9cefd0..f584850 100644 --- a/std/stdio.c +++ b/std/stdio.c @@ -2,9 +2,9 @@ #include <stdlib.h> char *readln() { - char *str = malloc(128); - fgets(str, 127, stdin); - return str; + char *str = malloc(128); + fgets(str, 127, stdin); + return str; } void print(char *str) { fputs(str, stdout); } @@ -18,19 +18,19 @@ void curshide() { print("\x1b[?25l"); } void cursshow() { print("\x1b[?25h"); } char *filer(char *path) { - FILE *fptr = fopen(path, "rb"); - char *contents = 0; + FILE *fptr = fopen(path, "rb"); + char *contents = 0; - if (fptr == NULL) { - return "File not found"; - } - fseek(fptr, 0, SEEK_END); - long size = ftell(fptr); - fseek(fptr, 0, SEEK_SET); + if (fptr == NULL) { + return "File not found"; + } + fseek(fptr, 0, SEEK_END); + long size = ftell(fptr); + fseek(fptr, 0, SEEK_SET); - contents = malloc(size); - fread(contents, 1, size, fptr); - fclose(fptr); + contents = malloc(size); + fread(contents, 1, size, fptr); + fclose(fptr); - return contents; + return contents; } |
