summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/grid-view.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-08-30 18:13:47 +0000
committernicm <nicm@openbsd.org>2017-08-30 18:13:47 +0000
commitbd28ed3555b247cd88312ff6885b2eaed763e290 (patch)
tree2f8d48b223c7a7ff2641ce6f397e3c240a341eba /usr.bin/tmux/grid-view.c
parentRefactor interface_status() to call freeifaddrs() (diff)
downloadwireguard-openbsd-bd28ed3555b247cd88312ff6885b2eaed763e290.tar.xz
wireguard-openbsd-bd28ed3555b247cd88312ff6885b2eaed763e290.zip
Instead of overloading the line clear function to mean free if
background is default (8), introduce an explicit free function and use it where a free alone is needed. Likewise, use memmove directly rather than grid_move_lines where it makes sense. Based on a memory leak fix by Dan Aloni in GitHub issue 1051.
Diffstat (limited to 'usr.bin/tmux/grid-view.c')
-rw-r--r--usr.bin/tmux/grid-view.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/grid-view.c b/usr.bin/tmux/grid-view.c
index 40ade691966..5910aaaf229 100644
--- a/usr.bin/tmux/grid-view.c
+++ b/usr.bin/tmux/grid-view.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grid-view.c,v 1.29 2017/05/12 13:00:56 nicm Exp $ */
+/* $OpenBSD: grid-view.c,v 1.30 2017/08/30 18:13:47 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -75,7 +75,7 @@ grid_view_clear_history(struct grid *gd, u_int bg)
/* Scroll the lines into the history. */
for (yy = 0; yy < last; yy++) {
- grid_collect_history(gd, bg);
+ grid_collect_history(gd);
grid_scroll_history(gd, bg);
}
if (last < gd->sy)
@@ -100,7 +100,7 @@ grid_view_scroll_region_up(struct grid *gd, u_int rupper, u_int rlower,
u_int bg)
{
if (gd->flags & GRID_HISTORY) {
- grid_collect_history(gd, bg);
+ grid_collect_history(gd);
if (rupper == 0 && rlower == gd->sy - 1)
grid_scroll_history(gd, bg);
else {