From d676d1bf4bb4ca2bf7d4bcc3a824940f6648f6ff Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 10 Nov 2016 21:01:32 -0800 Subject: 39893: use arrdup_max() to show explicitly the difference in two code branches no functional change --- ChangeLog | 5 +++++ Src/params.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee314487c..839548045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-11-10 Barton E. Schaefer + + * 39893: Src/params.c: use arrdup_max() to show explicitly the + difference in two code branches; no functional change + 2016-11-11 Daniel Shahaf * 39874/0002 plus size=0 handling: Src/mem.c: zshcalloc: Remove 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, -- cgit 1.4.1