aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum_get_algorithm_from_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhashsum_get_algorithm_from_string.c')
-rw-r--r--libhashsum_get_algorithm_from_string.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libhashsum_get_algorithm_from_string.c b/libhashsum_get_algorithm_from_string.c
index 96892e1..9740510 100644
--- a/libhashsum_get_algorithm_from_string.c
+++ b/libhashsum_get_algorithm_from_string.c
@@ -20,7 +20,9 @@ equiv(const char *a, const char *b)
}
if (!strncasecmp(a, "sum", 3))
a = &a[3];
- return !*a && (!*b || *b == '[');
+ if (*b == '[')
+ return *a == '[' || !*a;
+ return !*a && !*b;
}