]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
client: Fix has_feature().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 9 May 2023 17:42:21 +0000 (19:42 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 14 May 2023 14:32:56 +0000 (16:32 +0200)
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

index 2a6b47d6b2b095daadf05659eafd52abfb218b35..43527ddb71647eee5936760cda40e722085b21f8 100644 (file)
@@ -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;
 }