summaryrefslogtreecommitdiffstats
path: root/usr.bin/rs/rs.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/rs/rs.c')
-rw-r--r--usr.bin/rs/rs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
index 98cc3d4..df01c57 100644
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -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:
OpenPOWER on IntegriCloud