Compare commits
4 Commits
eee534d816
...
5a80a3761b
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a80a3761b | |||
| 2a9a9273e3 | |||
| 8b2983c3c4 | |||
| b873d87511 |
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user