summaryrefslogtreecommitdiff
path: root/Src/params.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-11-10 21:01:32 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2016-11-10 21:01:32 -0800
commitd676d1bf4bb4ca2bf7d4bcc3a824940f6648f6ff (patch)
tree7e485896352d41b611f7282fe738c4170163d3ac /Src/params.c
parentc238057ccc8b1bf97c3063e93ebdeec3b8ef10b1 (diff)
downloadzsh-d676d1bf4bb4ca2bf7d4bcc3a824940f6648f6ff.tar.gz
zsh-d676d1bf4bb4ca2bf7d4bcc3a824940f6648f6ff.zip
39893: use arrdup_max() to show explicitly the difference in two code branches
no functional change
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Src/params.c b/Src/params.c
index 86a094b1f..6f587a30a 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2293,10 +2293,9 @@ getarrvalue(Value v)
/* Null if 1) array too short, 2) index still negative */
if (arrlen_lt(s, v->start) || v->start < 0) {
- s = arrdup(nular);
+ s = arrdup_max(nular, 1);
} else if (v->end <= v->start) {
- s = arrdup_max(s, 1);
- s[0] = NULL;
+ 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,