X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/6633f16cd7b339def9ee1a7b10b6c03c4d9855c5..318c3c31be343fdba362cb60f33aab3e88798d8a:/progs/catcrypt.c diff --git a/progs/catcrypt.c b/progs/catcrypt.c index c31a3d93..e4d974aa 100644 --- a/progs/catcrypt.c +++ b/progs/catcrypt.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -194,14 +195,14 @@ static int encrypt(int argc, char *argv[]) die(EXIT_FAILURE, "encoding `%s' not found", ef); fn = optind < argc ? argv[optind++] : "-"; - if (strcmp(fn, "-") == 0) + if (STRCMP(fn, ==, "-")) fp = stdin; else if ((fp = fopen(fn, "rb")) == 0) { die(EXIT_FAILURE, "couldn't open file `%s': %s", fn, strerror(errno)); } - if (!of || strcmp(of, "-") == 0) + if (!of || STRCMP(of, ==, "-")) ofp = stdout; else if ((ofp = fopen(of, eo->wmode)) == 0) { die(EXIT_FAILURE, "couldn't open file `%s' for output: %s", @@ -366,7 +367,7 @@ static int decrypt(int argc, char *argv[]) die(EXIT_FAILURE, "encoding `%s' not found", ef); fn = optind < argc ? argv[optind++] : "-"; - if (strcmp(fn, "-") == 0) + if (STRCMP(fn, ==, "-")) fp = stdin; else if ((fp = fopen(fn, eo->rmode)) == 0) { die(EXIT_FAILURE, "couldn't open file `%s': %s", @@ -472,7 +473,7 @@ static int decrypt(int argc, char *argv[]) /* --- Now decrypt the main body --- */ - if (!of || strcmp(of, "-") == 0) { + if (!of || STRCMP(of, ==, "-")) { ofp = stdout; f |= f_buffer; }