From 2a6bb4354ed1b8b979c74775d2e4b56730e09735 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Tue, 12 Jul 2022 22:36:26 +0200 Subject: [PATCH] Fix: fail on error --- Implementierung/src/md2_impls/md2_2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Implementierung/src/md2_impls/md2_2.c b/Implementierung/src/md2_impls/md2_2.c index f1ab4b6..e250f05 100644 --- a/Implementierung/src/md2_impls/md2_2.c +++ b/Implementierung/src/md2_impls/md2_2.c @@ -46,7 +46,10 @@ void md2_checksum_2(size_t, uint8_t*) {} void md2_hash_2(size_t len, const uint8_t buf[len], uint8_t out[16]) { FILE* file; struct stat file_stat; - open_file((char*)buf, &file, &file_stat); + if (!open_file((char*)buf, &file, &file_stat)) { + fprintf(stderr, "Error opening the file!"); + return; + } // === step 3 === uint8_t* messageDigestBuf = calloc(48, sizeof(uint8_t));