]> granicus.if.org Git - neomutt/commitdiff
Fix AUXSORT usage in compare_spam
authorKevin McCarthy <kevin@8t8.us>
Sat, 28 Jul 2018 19:59:35 +0000 (12:59 -0700)
committerRichard Russon <rich@flatcap.org>
Sat, 1 Sep 2018 17:06:08 +0000 (18:06 +0100)
AUXSORT already checks if the first parameter is zero.

Additionally, the macro expands into more than one statement, so
putting inside an unbracketed if is misleading and generates a
warning on the latest gcc.

Fortunately, both statements checked if the first parameter was zero,
so no actual bug resulted.

sort.c

diff --git a/sort.c b/sort.c
index 4527f80ac76cca5e53bd0b7fcc4d9c80bebfd23c..139a846e76073c3e611c352e9826e84ea02d0fe3 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -264,10 +264,7 @@ static int compare_spam(const void *a, const void *b)
   if (result == 0)
   {
     result = strcmp(aptr, bptr);
-    if (result == 0)
-    {
-      result = perform_auxsort(result, a, b);
-    }
+    result = perform_auxsort(result, a, b);
   }
 
   return SORTCODE(result);