commit ac5431b14092dfa8dbe2431dbed813804ab3d577
parent 6e3ea85cccec28f645a3678d38d8532e3dedac56
Author: Louis Burda <quent.burda@gmail.com>
Date: Sun, 29 Jan 2023 01:53:48 +0100
fixup! Initial version
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hexdiff.c b/hexdiff.c
@@ -74,11 +74,15 @@ main(int argc, const char **argv)
} else if (!f2.fname) {
f2.fname = *arg;
} else {
- fprintf(stderr, "Usage: hexdiff [-c] FILE FILE\n");
- return 1;
+ break;
}
}
+ if (!f1.fname || !f2.fname || *arg) {
+ fprintf(stderr, "Usage: hexdiff [-c] FILE FILE\n");
+ return 1;
+ }
+
f1.file = fopen(f1.fname, "r");
if (!f1.file) err(1, "fopen %s", f1.fname);