aboutsummaryrefslogtreecommitdiff
path: root/src/hist.c
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-11-25 15:32:55 -0800
committerHaibo Huang <hhb@google.com>2019-11-25 15:34:35 -0800
commit892b8b381ae82ac3184900d989a516854d8b1197 (patch)
tree0d37bcbdabcdd0602b5444ceb0bb9af20a4496f3 /src/hist.c
parent459326d0af95beb84e0c94da3bc63ba9d764b3ea (diff)
downloadlibedit-llvm-r450784.tar.gz
Test: build Change-Id: I35977af76e0a89667a1858cffb1f1cb019ba4899
Diffstat (limited to 'src/hist.c')
-rw-r--r--src/hist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hist.c b/src/hist.c
index 3c9db7d..19ce1c1 100644
--- a/src/hist.c
+++ b/src/hist.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hist.c,v 1.32 2017/03/05 19:23:58 christos Exp $ */
+/* $NetBSD: hist.c,v 1.34 2019/07/23 10:19:35 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: hist.c,v 1.32 2017/03/05 19:23:58 christos Exp $");
+__RCSID("$NetBSD: hist.c,v 1.34 2019/07/23 10:19:35 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -59,10 +59,10 @@ hist_init(EditLine *el)
el->el_history.fun = NULL;
el->el_history.ref = NULL;
- el->el_history.buf = el_malloc(EL_BUFSIZ * sizeof(*el->el_history.buf));
- el->el_history.sz = EL_BUFSIZ;
+ el->el_history.buf = el_calloc(EL_BUFSIZ, sizeof(*el->el_history.buf));
if (el->el_history.buf == NULL)
return -1;
+ el->el_history.sz = EL_BUFSIZ;
el->el_history.last = el->el_history.buf;
return 0;
}