#include <mLib/alloc.h>
#include <mLib/base64.h>
+#include <mLib/macros.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/report.h>
if (getstring(fp, &d, GSF_FILE))
return (E_EOF);
for (tag = 0; tagtab[tag]; tag++) {
- if (strcmp(tagtab[tag], d.buf) == 0)
+ if (STRCMP(tagtab[tag], ==, d.buf))
goto done;
}
return (E_TAG);
} else {
if (getstring(fp, &b->d, GSF_FILE))
return (E_EOF);
- if (strcmp(b->d.buf, "forever") == 0)
+ if (STRCMP(b->d.buf, ==, "forever"))
b->t = KEXP_FOREVER;
else if ((b->t = get_date(b->d.buf, 0)) == -1)
return (E_DATE);
ki = optarg;
break;
case 'e':
- if (strcmp(optarg, "forever") == 0)
+ if (STRCMP(optarg, ==, "forever"))
exp = KEXP_FOREVER;
else if ((exp = get_date(optarg, 0)) == -1)
die(EXIT_FAILURE, "bad expiry time");
/* --- Open files --- */
if (hfile) ifile = hfile;
- if (!ifile || strcmp(ifile, "-") == 0)
+ if (!ifile || STRCMP(ifile, ==, "-"))
ifp = stdin;
else if ((ifp = fopen(ifile, (f & f_bin) ? "rb" : "r")) == 0) {
die(EXIT_FAILURE, "couldn't open input file `%s': %s",
ifile, strerror(errno));
}
- if (!ofile || strcmp(ofile, "-") == 0)
+ if (!ofile || STRCMP(ofile, ==, "-"))
ofp = stdout;
else if ((ofp = fopen(ofile, (f & f_bin) ? "wb" : "w")) == 0) {
die(EXIT_FAILURE, "couldn't open output file `%s': %s",
}
f |= f_bogus;
} else if (b.b.len != GH_CLASS(s->h)->hashsz ||
- memcmp(d.buf, b.b.buf, b.b.len) != 0) {
+ MEMCMP(d.buf, !=, b.b.buf, b.b.len)) {
if (verb > 1)
printf("BAD file `%s' has incorrect hash\n", b.d.buf);
f |= f_bogus;