Fix: return size in read_file

This commit is contained in:
Dorian Zedler 2022-06-29 10:15:45 +02:00
parent ec4445e24a
commit 23e1c40539
Signed by: dorian
GPG key ID: 989DE36109AFA354

View file

@ -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;
}