diff options
Diffstat (limited to 'analyzer')
-rw-r--r-- | analyzer/pgmhist.c | 6 | ||||
-rw-r--r-- | analyzer/pnmpsnr.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/analyzer/pgmhist.c b/analyzer/pgmhist.c index 5db1c0e6..fc55b1a7 100644 --- a/analyzer/pgmhist.c +++ b/analyzer/pgmhist.c @@ -40,9 +40,11 @@ parseCommandLine(int argc, const char ** argv, optEntry * option_def; unsigned int option_def_index; - MALLOCARRAY(option_def, 100); + MALLOCARRAY_NOFAIL(option_def, 100); - option_def_index = 0; /* incremented by OPTENTRY */ + option_def_index = 0; /* incremented by OPTENT3 */ + + OPTENTINIT; opt.opt_table = option_def; opt.short_allowed = FALSE; /* We have no short (old-fashioned) options */ diff --git a/analyzer/pnmpsnr.c b/analyzer/pnmpsnr.c index c32f7d64..1160fff6 100644 --- a/analyzer/pnmpsnr.c +++ b/analyzer/pnmpsnr.c @@ -150,7 +150,7 @@ main (int argc, char **argv) { pnm_init(&argc, argv); - if (argc < 2) + if (argc-1 < 2) pm_error("Takes two arguments: specifications of the two files."); else { filespec1 = argv[1]; |