Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / progs / cookie.c
index c6912ff..62e23b7 100644 (file)
@@ -39,6 +39,7 @@
 #include <mLib/base64.h>
 #include <mLib/bits.h>
 #include <mLib/dstr.h>
+#include <mLib/macros.h>
 #include <mLib/mdwopt.h>
 #include <mLib/quis.h>
 #include <mLib/report.h>
@@ -178,7 +179,7 @@ static gmac *getmac(key *k, const char *app)
   if ((q = key_getattr(0, k, "mac")) != 0) {
     dstr_puts(&d, q);
     p = d.buf;
-  } else if (strncmp(k->type, app, n) == 0 && k->type[n] == '-') {
+  } else if (STRNCMP(k->type, ==, app, n) && k->type[n] == '-') {
     dstr_puts(&d, k->type);
     p = d.buf + n + 1;
   } else
@@ -258,7 +259,7 @@ static int cmd_gen(int argc, char *argv[])
       /* --- Fetch an expiry time --- */
 
       case 'e':
-       if (strcmp(optarg, "forever") == 0)
+       if (STRCMP(optarg, ==, "forever"))
          c.exp = KEXP_FOREVER;
        else if ((c.exp = get_date(optarg, 0)) == -1)
          die(EXIT_FAILURE, "bad expiry date: `%s'", optarg);