From 84eff8315955e1a6da8c3d15fa6c18203d55aa4a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 9 May 2023 19:42:21 +0200 Subject: [PATCH] client: Fix has_feature(). The function returns bool, so a return value of zero is regarded as false. Consequently, server feature #0 (sha256) is not detected even if it is announced by the server, and therefore the client does not request it. Hence both sides fall back to sha1. This bug was introduced in paraslash-0.7.2. Fixes: a0707daa23f8706326aa837f969c20d3e4ee02aa --- client_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client_common.c b/client_common.c index 2a6b47d6..43527ddb 100644 --- a/client_common.c +++ b/client_common.c @@ -262,7 +262,7 @@ static bool has_feature(const char *feature, struct client_task *ct) return false; for (int i = 0; ct->features[i]; i++) if (strcmp(feature, ct->features[i]) == 0) - return i; + return true; return false; } -- 2.39.2