Compare commits

...

4 Commits

Author SHA1 Message Date
5a80a3761b update acl 2020-06-24 21:52:32 +02:00
2a9a9273e3 Squashed 'lib/advanced_C_standard_liberary/' changes from cea7d71..cf9856d
cf9856d fixed file.h

git-subtree-dir: lib/advanced_C_standard_liberary
git-subtree-split: cf9856d0614a5a4ac4b27c1f5b615a9fb0fb4d0e
2020-06-24 21:52:32 +02:00
8b2983c3c4 Update acl 2020-06-24 21:48:10 +02:00
b873d87511 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
2020-06-24 21:48:10 +02:00
2 changed files with 3 additions and 6 deletions

View File

@ -1,5 +1,5 @@
#ifndef acl_file_h
#define acl_file_h
#include <stdbool.h>
char* acl_ReadTextFile(char *filePath, bool *sucess);
char* acl_ReadTextFile(const char *filePath, bool *sucess);
#endif

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
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;
}