summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/Zle/zle_utils.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 526ae5265..851c7e3ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2023-04-03 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+
+ * 51597: Src/Zle/zle_utils.c: fix 'vared -c var' when var is unset
+
2023-03-30 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 51604: Src/jobs.c, configure.ac: %M in TIMEFMT should report
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index 454a877a9..51bb43339 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -512,12 +512,13 @@ stringaszleline(char *instr, int incs, int *outll, int *outsz, int *outcs)
*outcs = outptr - outstr;
*outll = outptr - outstr;
} else {
+ *outstr = ZWC('\0');
*outll = 0;
if (outcs)
*outcs = 0;
}
#else
- memcpy(outstr, instr, ll);
+ strcpy(outstr, instr);
*outll = ll;
if (outcs)
*outcs = incs;