From b6cc5cdbb31a88296de6776ba29374b0ff072660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 22 Aug 2012 09:25:35 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Fix Choose() when then the choice value is equal to the number of possible results plus one. git-svn-id: svn://localhost/gambas/trunk@5068 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_subr_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/gbx/gbx_subr_test.c b/main/gbx/gbx_subr_test.c index dd49e21b2..ba3bc19dc 100644 --- a/main/gbx/gbx_subr_test.c +++ b/main/gbx/gbx_subr_test.c @@ -333,7 +333,7 @@ void SUBR_choose(ushort code) VALUE_conv_integer(PARAM); val = PARAM->_integer.value; - if (val >= 1 && val <= NPARAM) + if (val >= 1 && val < NPARAM) { VALUE_conv_variant(&PARAM[val]); *RETURN = PARAM[val];