X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/e74ca64c0ec65a93d2f133c4472256e3bbb688e2..141c12847a1c2f8cc8db03d420551584e689fb87:/symm/strobe.c diff --git a/symm/strobe.c b/symm/strobe.c index 8d4d42da..de4dbb2d 100644 --- a/symm/strobe.c +++ b/symm/strobe.c @@ -468,6 +468,7 @@ void strobe_ratchet(strobe_ctx *ctx, unsigned f, size_t sz) #include #include +#include #include #define NSTATE 16 @@ -487,7 +488,7 @@ static void dump(int rc, char win, const void *p, size_t sz) else putchar('-'); } else { for (i = 0, printable = 1; i < sz; i++) - if (!isprint((unsigned char)q[i])) { printable = 0; break; } + if (!ISPRINT(q[i])) { printable = 0; break; } if (printable) printf("`%s'", q); else { @@ -601,7 +602,7 @@ static int verify(dstr v[]) /* Next job is to parse the command and flags. */ q = v[1].buf; p = q; q += strcspn(q, "/"); if (*q) *q++ = 0; for (op = optab; op->name; op++) - if (!strcmp(op->name, p)) goto found_op; + if (STRCMP(op->name, ==, p)) goto found_op; abort(); found_op: @@ -654,7 +655,7 @@ found_op: rc = op->op(ctx, f, src, dest, sz); /* Check we got the right answer. */ - ok = (rc == rcref && (!destref || !memcmp(dest, destref, sz))); + ok = (rc == rcref && (!destref || MEMCMP(dest, ==, destref, sz))); if (!ok) { printf("failed test\n"); printf(" state = %d\n", r);