From 3325b3e9b0328ecdebe6cce913766c306721f334 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 27 Jun 2016 14:51:18 -0700 Subject: Fix iteration for start/stop without arguments. --- toys/android/start.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toys/android/start.c b/toys/android/start.c index 1f358e90..20fa2b9e 100644 --- a/toys/android/start.c +++ b/toys/android/start.c @@ -40,9 +40,9 @@ static void start_stop(int start) if (getuid()) error_exit("must be root"); if (!*ss) { - // Iterate through optargs, or services forward/backward. + // If we don't have optargs, iterate through services forward/backward. ss = services+1; - if (!start) ss += ARRAY_LEN(services)-1, direction = -1; + if (!start) ss = services+ARRAY_LEN(services)-2, direction = -1; } for (; *ss; ss += direction) -- cgit v1.2.3