From 4ee31d5e2b10a12db1864f685d294c46267c476c Mon Sep 17 00:00:00 2001 From: James Juran Date: Sat, 19 May 2001 17:34:17 +0000 Subject: [PATCH] Accept responses from 1..n when choosing from multiple symbols to match the input labels. --- debugger/hash.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debugger/hash.c b/debugger/hash.c index 204b53111e2..86c809a7a0e 100644 --- a/debugger/hash.c +++ b/debugger/hash.c @@ -402,7 +402,12 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, ptr = readline("=> "); if (!*ptr) return FALSE; i = atoi(ptr); - } while (i < 0 || i >= num); + if (i < 1 || i > num) + DEBUG_Printf(DBG_CHN_MESG, "Invalid choice %d\n", i); + } while (i < 1 || i > num); + + /* The array is 0-based, but the choices are 1..n, so we have to subtract one before returning. */ + i--; } *rtn = value[i]; return TRUE;