From b22061718db0111f9e7474f9b60aef02456ac070 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 3 Apr 2016 22:29:35 +0200 Subject: find_applet_by_name: loop index should be signed The loop for (j = ARRAY_SIZE(applet_nameofs)-1; j >= 0; j--) { was intended to terminate when j goes negative, so j needs to be signed. Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- libbb/appletlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libbb/appletlib.c') diff --git a/libbb/appletlib.c b/libbb/appletlib.c index d798a2eac..de654f64c 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -141,7 +141,8 @@ void FAST_FUNC bb_show_usage(void) int FAST_FUNC find_applet_by_name(const char *name) { - unsigned i, j, max; + unsigned i, max; + int j; const char *p; /* The commented-out word-at-a-time code is ~40% faster, but +160 bytes. -- cgit v1.2.3