We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aee470a commit 4998d1eCopy full SHA for 4998d1e
1 file changed
src/shell/image/sha256_file.c
@@ -26,7 +26,7 @@ int sha256_file(const char *path, char *hash)
26
27
int fd = open(path, O_RDONLY);
28
if (fd < 0) {
29
- return -1;
+ return -2;
30
}
31
32
struct stat finfo;
@@ -57,7 +57,6 @@ int sha256_file(const char *path, char *hash)
57
58
59
if (!bytes_read) {
60
- ret = 0;
61
break;
62
63
@@ -66,6 +65,8 @@ int sha256_file(const char *path, char *hash)
66
65
total_bytes_read += bytes_read;
67
68
+ ret = 0;
69
+
70
sha256_finalize(&buff);
71
sha256_read_hex(&buff, hash);
72
0 commit comments