Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / key / key-attr.c
index e884d69..567fb92 100644 (file)
@@ -34,6 +34,7 @@
 #include <time.h>
 
 #include <mLib/dstr.h>
+#include <mLib/macros.h>
 #include <mLib/sym.h>
 
 #include "key.h"
@@ -54,7 +55,7 @@ int key_chkident(const char *p)
   if (!p || !*p || strlen(p) > 255)
     return (-1);
   while (*p) {
-    if (*p == ':' || *p == '.' || isspace((unsigned char)*p))
+    if (*p == ':' || *p == '.' || ISSPACE(*p))
       return (-1);
     p++;
   }
@@ -252,8 +253,7 @@ int key_settag(key_file *f, key *k, const char *tag)
 
   /* --- See if the new tag is the same as the old one --- */
 
-  if ((!tag && !k->tag) ||
-      (tag && k->tag && strcmp(tag, k->tag) == 0))
+  if ((!tag && !k->tag) || (tag && k->tag && STRCMP(tag, ==, k->tag)))
     return (0);
 
   /* --- Allocate an entry for the new tag --- */