X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=util.c;h=9da8f52b58cb01f5515758372c3f57023f405286;hp=76ba5abb45eb5f502a4ed3f31672ff1402c369d2;hb=d6e0e6e9879c144f5d374fca0c015fd6208fc27e;hpb=b1669b5c48f71c9a7a919dbf09a1af527c62f69a 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); }