aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pw.c b/pw.c
index cc3a19b..4890d0f 100644
--- a/pw.c
+++ b/pw.c
@@ -389,8 +389,9 @@ static void drawstatus(unsigned hist, int columns, unsigned stat, char *cmd)
static void freebuf(char **buf, size_t size)
{
- for (size_t i = 0; i < size; i++)
- dsdrop(buf[i]);
+ if (buf != 0)
+ for (size_t i = 0; i < size; i++)
+ dsdrop(buf[i]);
}
static unsigned redraw(char **circbuf, int nlines, unsigned hpos, unsigned hist,