Fix: return size in read_file
This commit is contained in:
parent
ec4445e24a
commit
23e1c40539
1 changed files with 2 additions and 1 deletions
|
@ -24,7 +24,7 @@ void md2_hash(size_t len, const uint8_t buf[len], uint8_t out[16]) {
|
|||
|
||||
}
|
||||
|
||||
static uint8_t* read_file(const char* path) {
|
||||
static uint8_t* read_file(const char* path, size_t* size) {
|
||||
// Read the contents of the file specified by path into a heap-allocated
|
||||
// buffer and return a pointer to that buffer.
|
||||
FILE* f = fopen(path, "r");
|
||||
|
@ -60,6 +60,7 @@ static uint8_t* read_file(const char* path) {
|
|||
|
||||
fclose(f);
|
||||
|
||||
(*size) = bytesRead;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue