From 38762cdce16e38d357858170239200628421b5f9 Mon Sep 17 00:00:00 2001
From: markw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Date: Tue, 6 Jun 2000 17:40:32 +0000
Subject: Fixed segfault when you type "chmod -R". "chown -R" and "chgrp -R"
 are still having problems...

git-svn-id: svn://busybox.net/trunk/busybox@617 69ca8d6d-28ef-0310-b511-8ec308f3f277
---
 chmod_chown_chgrp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c
index c782eb3c4..c0e380a8e 100644
--- a/chmod_chown_chgrp.c
+++ b/chmod_chown_chgrp.c
@@ -118,7 +118,7 @@ int chmod_chown_chgrp_main(int argc, char **argv)
 	argv++;
 
 	/* Parse options */
-	while (**argv == '-') {
+	while (argc && (**argv == '-')) {
 		while (*++(*argv))
 			switch (**argv) {
 			case 'R':
-- 
cgit v1.2.3-55-g6feb