about summary refs log tree commit diff stats
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 76ba5ab..9da8f52 100644
--- a/util.c
+++ b/util.c
@@ -134,7 +134,7 @@ pipe_spawn(char *buf, unsigned int len, Display *dpy, char *argv[])
 			n += l;
 		}
 		close(pfd[0]);
-		buf[n - 1] = 0;
+		buf[n < len ? n : len - 1] = 0;
 	}
 	wait(0);
 }