JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
several changes, new stuff
[dwm.git] / util.c
diff --git a/util.c b/util.c
index 76ba5ab..9da8f52 100644 (file)
--- 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);
 }