From 23e1c405395b23ad1c24053835503658a301dc0d Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Wed, 29 Jun 2022 10:15:45 +0200 Subject: [PATCH] Fix: return size in read_file --- Implementierung/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Implementierung/main.c b/Implementierung/main.c index 6b751f0..cfe03a9 100644 --- a/Implementierung/main.c +++ b/Implementierung/main.c @@ -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; }