diff options
Diffstat (limited to 'Src/params.c')
-rw-r--r-- | Src/params.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/params.c b/Src/params.c index 6f587a30a..3c8658cc3 100644 --- a/Src/params.c +++ b/Src/params.c @@ -2292,10 +2292,11 @@ getarrvalue(Value v) v->end += arrlen(s) + 1; /* Null if 1) array too short, 2) index still negative */ - if (arrlen_lt(s, v->start) || v->start < 0) { + if (v->end <= v->start) { + s = arrdup_max(nular, 0); + } + else if (arrlen_lt(s, v->start) || v->start < 0) { s = arrdup_max(nular, 1); - } else if (v->end <= v->start) { - s = arrdup_max(nular, 0); } else { /* Copy to a point before the end of the source array: * arrdup_max will copy at most v->end - v->start elements, |