From: Andre Noll Date: Tue, 9 May 2023 17:42:21 +0000 (+0200) Subject: client: Fix has_feature(). X-Git-Tag: v0.7.3~21 X-Git-Url: http://git.tuebingen.mpg.de/libdai.git/tree?a=commitdiff_plain;h=84eff8315955e1a6da8c3d15fa6c18203d55aa4a;p=paraslash.git 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 --- 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; }