Validate argument to -i.

This commit is contained in:
Juli Mallett 2004-03-15 03:41:07 +00:00
parent 5e71a73b7b
commit 9c4c393a74

View File

@ -91,11 +91,14 @@ main(int argc, char** argv)
int verbose = 0;
int fileid = 0;
char* filename = NULL;
char* p;
while ((c = getopt(argc, argv, "i:n:v")) != -1)
switch (c) {
case 'i':
fileid = atoi(optarg);
fileid = (int)strtoul(optarg, &p, 10);
if (*p != '\0')
usage();
break;
case 'n':
filename = optarg;