mirror of
https://github.com/openharmony/third_party_fsverity-utils.git
synced 2026-07-01 10:05:35 -04:00
lib/hash_algs.c: start search from alg_num=1
Since 0 means "invalid algorithm", when iterating through fsverity_hash_algs[] it makes sense to start at 1 rather than 0. Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
+1
-1
@@ -166,7 +166,7 @@ libfsverity_find_hash_alg_by_name(const char *name)
|
||||
if (!name)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(fsverity_hash_algs); i++) {
|
||||
for (i = 1; i < ARRAY_SIZE(fsverity_hash_algs); i++) {
|
||||
if (fsverity_hash_algs[i].name &&
|
||||
!strcmp(name, fsverity_hash_algs[i].name))
|
||||
return i;
|
||||
|
||||
Reference in New Issue
Block a user