X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/e74ca64c0ec65a93d2f133c4472256e3bbb688e2..141c12847a1c2f8cc8db03d420551584e689fb87:/progs/dsig.c diff --git a/progs/dsig.c b/progs/dsig.c index 1377bcaa..3f217da6 100644 --- a/progs/dsig.c +++ b/progs/dsig.c @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -204,7 +205,7 @@ static int bget(block *b, FILE *fp, unsigned bin) 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); @@ -239,7 +240,7 @@ static int bget(block *b, FILE *fp, unsigned bin) } 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); @@ -536,7 +537,7 @@ static int sign(int argc, char *argv[]) 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"); @@ -572,14 +573,14 @@ static int sign(int argc, char *argv[]) /* --- 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", @@ -908,7 +909,7 @@ static int verify(int argc, char *argv[]) } 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;