summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2017-08-28 19:41:56 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2017-08-28 19:41:56 +0000
commit54e6c33182692e5195dee0aeced246d2690c2888 (patch)
tree961012c44b40ff26cc3cb2ea305af08e71a188f4 /bin/ksh
parent9ff82b6416aa08eaaeacba119dc8d3b380bb4238 (diff)
Don't bother setting freed history lines to NULL.
Dead code that could send the wrong hint to an unsuspicious reader. The code should walk use 'history' & 'histptr' to walk the array. ok millert@, "go for it" tb@
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/history.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c
index 584c8748b85..e0f98e489e7 100644
--- a/bin/ksh/history.c
+++ b/bin/ksh/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.67 2017/08/28 19:39:13 jca Exp $ */
+/* $OpenBSD: history.c,v 1.68 2017/08/28 19:41:55 jca Exp $ */
/*
* command history
@@ -439,10 +439,8 @@ histreset(void)
{
char **hp;
- for (hp = history; hp <= histptr; hp++) {
+ for (hp = history; hp <= histptr; hp++)
afree(*hp, APERM);
- *hp = NULL;
- }
histptr = history - 1;
hist_source->line = 0;
@@ -530,10 +528,8 @@ sethistsize(int n)
char **hp;
offset = n - 1;
- for (hp = history; hp < histptr - offset; hp++) {
+ for (hp = history; hp < histptr - offset; hp++)
afree(*hp, APERM);
- *hp = NULL;
- }
memmove(history, histptr - offset, n * sizeof(char *));
}