Fix: fail on error
This commit is contained in:
parent
03016a1979
commit
2a6bb4354e
1 changed files with 4 additions and 1 deletions
|
@ -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]) {
|
void md2_hash_2(size_t len, const uint8_t buf[len], uint8_t out[16]) {
|
||||||
FILE* file;
|
FILE* file;
|
||||||
struct stat file_stat;
|
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 ===
|
// === step 3 ===
|
||||||
uint8_t* messageDigestBuf = calloc(48, sizeof(uint8_t));
|
uint8_t* messageDigestBuf = calloc(48, sizeof(uint8_t));
|
||||||
|
|
Loading…
Reference in a new issue