From 2c15891937c6fb9f3b5e70ae0f0d0d906e4c03ed Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 30 Aug 2024 19:58:07 +0200 Subject: Add more tests + m fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libhashsum_get_algorithm_from_string.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libhashsum_get_algorithm_from_string.c') 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; } -- cgit v1.2.3-70-g09d2