From b873d8751195b4e90fd2c3a106b8a37e1fce93c7 Mon Sep 17 00:00:00 2001 From: MrGeorgen Date: Wed, 24 Jun 2020 21:48:10 +0200 Subject: [PATCH] Squashed 'lib/advanced_C_standard_liberary/' changes from a87fc37..cea7d71 cea7d71 acl_ReadTextFile takes now a const char *filePath as argument 59740ea fixed acl_ReadtextFile git-subtree-dir: lib/advanced_C_standard_liberary git-subtree-split: cea7d71b8c9379347770153ab5b7643cbdf7601d --- src/file.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/file.c b/src/file.c index 3c470e9..0963fa3 100644 --- a/src/file.c +++ b/src/file.c @@ -1,7 +1,7 @@ #include #include #include -char* acl_ReadTextFile(char *filePath, bool *sucess){ +char* acl_ReadTextFile(const char *filePath, bool *sucess){ FILE *fp = fopen(filePath, "rb"); size_t lSize; char *buffer; @@ -20,9 +20,6 @@ char* acl_ReadTextFile(char *filePath, bool *sucess){ } size_t readReturn = fread(buffer, lSize, 1, fp); fclose(fp); - if(readReturn != 1) { - *sucess = false; - } - *sucess = true; + *sucess = readReturn == 1; return buffer; }