From b888a221f832fd378db9e22f10155146c4fa4c5a Mon Sep 17 00:00:00 2001 From: Nic Gaffney Date: Thu, 23 Oct 2025 13:22:58 -0500 Subject: random stuff MERGE --- std/stdio.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'std') 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 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; } -- cgit v1.2.3