Module Name:    src
Committed By:   christos
Date:           Sun Mar  5 19:23:58 UTC 2017

Modified Files:
        src/lib/libedit: hist.c

Log Message:
one extra char for NUL.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libedit/hist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/hist.c
diff -u src/lib/libedit/hist.c:1.31 src/lib/libedit/hist.c:1.32
--- src/lib/libedit/hist.c:1.31	Sun Mar  5 12:30:38 2017
+++ src/lib/libedit/hist.c	Sun Mar  5 14:23:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: hist.c,v 1.31 2017/03/05 17:30:38 christos Exp $	*/
+/*	$NetBSD: hist.c,v 1.32 2017/03/05 19:23:58 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.31 2017/03/05 17:30:38 christos Exp $");
+__RCSID("$NetBSD: hist.c,v 1.32 2017/03/05 19:23:58 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -131,7 +131,7 @@ hist_get(EditLine *el)
 		if ((hp = HIST_NEXT(el)) == NULL)
 			goto out;
 
-	hlen = wcslen(hp);
+	hlen = wcslen(hp) + 1;
 	blen = (size_t)(el->el_line.limit - el->el_line.buffer);
 	if (hlen > blen && !ch_enlargebufs(el, hlen))
 		goto out;

Reply via email to