From e161af47bbe89ac4d6ac8a050f7e1f90a624d19e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 23 Feb 2008 09:22:06 +0000 Subject: [PATCH] backport: don't overlook 2nd and later single-letter options in last argument. --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 4988f6c..3aa0038 100644 --- a/src/main.c +++ b/src/main.c @@ -178,8 +178,10 @@ main( int argc, char **argv ) } arc4_init(); - for (oind = 1, ochar = 0; oind < argc; ) { + for (oind = 1, ochar = 0; ; ) { if (!ochar || !*ochar) { + if (oind >= argc) + break; if (argv[oind][0] != '-') break; if (argv[oind][1] == '-') {