Fix printing of number of whitelist entries in debug mode.
authormillert <millert@openbsd.org>
Tue, 13 Jan 2015 21:45:53 +0000 (21:45 +0000)
committermillert <millert@openbsd.org>
Tue, 13 Jan 2015 21:45:53 +0000 (21:45 +0000)
libexec/spamd-setup/spamd-setup.c

index e14d60f..b1e28d0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: spamd-setup.c,v 1.40 2015/01/13 21:42:59 millert Exp $ */
+/*     $OpenBSD: spamd-setup.c,v 1.41 2015/01/13 21:45:53 millert Exp $ */
 
 /*
  * Copyright (c) 2003 Bob Beck.  All rights reserved.
@@ -737,6 +737,9 @@ getlist(char ** db_array, char *name, struct blacklist *blist,
                return (0);
        }
        if (black) {
+               if (debug)
+                       fprintf(stderr, "blacklist %s %zu entries\n",
+                           name, blc / 2);
                blistnew->message = message;
                blistnew->name = name;
                blistnew->black = black;
@@ -745,13 +748,13 @@ getlist(char ** db_array, char *name, struct blacklist *blist,
                blistnew->bls = bls;
        } else {
                /* whitelist applied to last active blacklist */
+               if (debug)
+                       fprintf(stderr, "whitelist %s %zu entries\n",
+                           name, (blc - blist->blc) / 2);
                blist->bl = bl;
                blist->blc = blc;
                blist->bls = bls;
        }
-       if (debug)
-               fprintf(stderr, "%slist %s %zu entries\n",
-                   black ? "black" : "white", name, blc / 2);
        return (black);
 }