From 210eb932ec4705f55fb8bb62836b4dedf948bf87 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Thu, 6 Feb 2003 22:05:47 +0000 Subject: [PATCH] Fixed problem with too many arguments. --- tools/ppm2tiff.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/ppm2tiff.c b/tools/ppm2tiff.c index bee5bc17..2c66c057 100644 --- a/tools/ppm2tiff.c +++ b/tools/ppm2tiff.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/tools/ppm2tiff.c,v 1.3 1999-12-27 17:35:01 mwelles Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/tools/ppm2tiff.c,v 1.4 2003-02-06 22:05:47 dron Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -91,6 +91,11 @@ main(int argc, char* argv[]) /*NOTREACHED*/ } + if ( optind + 2 < argc ) { + fprintf(stderr, "%s: Too many arguments\n", argv[0]); + usage(); + } + /* * If only one file is specified, read input from * stdin; otherwise usage is: ppm2tiff input output.