[gnumeric] SWITCH: When off-argument default case.



commit 1be7191cb78fdddabacc87d822324d550c594b04
Author: Morten Welinder <terra gnome org>
Date:   Sat Sep 1 19:25:46 2018 -0400

    SWITCH: When off-argument default case.

 NEWS                           | 3 +++
 plugins/fn-logical/functions.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/NEWS b/NEWS
index e13c530d3..8c8252887 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.12.44
 
+Morten:
+       * Fix SWITCH's default argument.  [#354]
+
 --------------------------------------------------------------------------
 Gnumeric 1.12.43
 
diff --git a/plugins/fn-logical/functions.c b/plugins/fn-logical/functions.c
index 8d87a5a6c..68143bb42 100644
--- a/plugins/fn-logical/functions.c
+++ b/plugins/fn-logical/functions.c
@@ -332,7 +332,7 @@ gnumeric_switch (GnmFuncEvalInfo *ei, int argc, GnmExprConstPtr const *argv)
        if (VALUE_IS_ERROR (ref))
                return ref;
 
-       for (a = 1; !res && a + 1 <= argc; a += 2) {
+       for (a = 1; !res && a + 1 < argc; a += 2) {
                GnmValue *v;
 
                v = gnm_expr_eval (argv[a], ei->pos, GNM_EXPR_EVAL_SCALAR_NON_EMPTY);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]