summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2017-07-24 23:56:37 +0000
committertb <tb@openbsd.org>2017-07-24 23:56:37 +0000
commit6dc9960259aa90270aaaa37e16f5bd334a4e1965 (patch)
tree9097c4e79c981e4f130c56bbe1ec128184ae26d2
parentsync (diff)
downloadwireguard-openbsd-6dc9960259aa90270aaaa37e16f5bd334a4e1965.tar.xz
wireguard-openbsd-6dc9960259aa90270aaaa37e16f5bd334a4e1965.zip
Fix off-by-one error introduced in the previous commit.
ok jca
-rw-r--r--bin/ksh/history.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c
index 3eff7ee75ad..14e0c4a29a9 100644
--- a/bin/ksh/history.c
+++ b/bin/ksh/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.61 2017/07/24 22:28:09 jca Exp $ */
+/* $OpenBSD: history.c,v 1.62 2017/07/24 23:56:37 tb Exp $ */
/*
* command history
@@ -614,7 +614,7 @@ histsave(int lno, const char *cmd, int dowrite)
if ((cp = strrchr(c, '\n')) != NULL)
*cp = '\0';
- if (histptr < history + histsize)
+ if (histptr < history + histsize - 1)
histptr++;
else { /* remove oldest command */
afree(*history, APERM);