mirror of
https://github.com/sheumann/hush.git
synced 2024-11-06 12:07:57 +00:00
Return 1 upon failure
This commit is contained in:
parent
f1c4b11b24
commit
6db8c22d07
@ -149,6 +149,7 @@ extern int hash_files(int argc, char **argv, const uint8_t hash_algo)
|
|||||||
if (!(flags & FLAG_SILENT))
|
if (!(flags & FLAG_SILENT))
|
||||||
printf("%s: FAILED\n", filename_ptr);
|
printf("%s: FAILED\n", filename_ptr);
|
||||||
count_failed++;
|
count_failed++;
|
||||||
|
return_value = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
/* possible free(NULL) */
|
/* possible free(NULL) */
|
||||||
free(hash_value);
|
free(hash_value);
|
||||||
@ -178,7 +179,7 @@ extern int hash_files(int argc, char **argv, const uint8_t hash_algo)
|
|||||||
|
|
||||||
hash_value = hash_file(file_ptr, hash_algo);
|
hash_value = hash_file(file_ptr, hash_algo);
|
||||||
if (hash_value == NULL) {
|
if (hash_value == NULL) {
|
||||||
return_value++;
|
return_value = EXIT_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
printf("%s %s\n", hash_value, file_ptr);
|
printf("%s %s\n", hash_value, file_ptr);
|
||||||
free(hash_value);
|
free(hash_value);
|
||||||
|
Loading…
Reference in New Issue
Block a user