From e18ca280fb9d1aceb269f1fb104c557abc14dfa2 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 10 Nov 2000 08:20:55 -0800 Subject: [PATCH] [svn] Fix off-by-one error in comind(). Published in . --- src/ChangeLog | 4 ++++ src/init.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 181720a9..e050bbbd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2000-11-10 Hrvoje Niksic + + * init.c (comind): Initialize MAX to array size - 1. + 2000-11-08 Hrvoje Niksic * url.c (construct): Changed last_slash[-1] to *(last_slash - 1). diff --git a/src/init.c b/src/init.c index f96f41b9..38b065fa 100644 --- a/src/init.c +++ b/src/init.c @@ -174,7 +174,7 @@ static struct { static int comind (const char *com) { - int min = 0, max = ARRAY_SIZE (commands); + int min = 0, max = ARRAY_SIZE (commands) - 1; do { -- 2.39.2