- Set negative row or column argument values to zero.

Negative values would produce undefined behaviour including
   a possible segmentation fault.
 - Explicitly initialize the global row and column variables
   to zero.

PR:		bin/80348
This commit is contained in:
robert 2005-04-28 12:37:15 +00:00
parent cb2545c652
commit 848d150573

View File

@ -86,7 +86,7 @@ char *curline;
int allocsize = BUFSIZ;
int curlen;
int irows, icols;
int orows, ocols;
int orows = 0, ocols = 0;
int maxlen;
int skip;
int propgutter;
@ -482,9 +482,11 @@ getargs(int ac, char *av[])
/*case 3:
opages = atoi(av[2]);*/
case 2:
ocols = atoi(av[1]);
if ((ocols = atoi(av[1])) < 0)
ocols = 0;
case 1:
orows = atoi(av[0]);
if ((orows = atoi(av[0])) < 0)
orows = 0;
case 0:
break;
default: