diff options
author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-12 17:50:31 +0200 |
---|---|---|
committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-12 17:50:31 +0200 |
commit | b1701adf75297747c52e0c3ed2c314cd10129907 (patch) | |
tree | 5afad14f6b53c57b1c063df3ddc434fe138ec5f7 /util.c | |
parent | 2e836ecce1ba0629a6088b739c1092d27fccd72b (diff) | |
download | dwm-b1701adf75297747c52e0c3ed2c314cd10129907.tar.gz dwm-b1701adf75297747c52e0c3ed2c314cd10129907.tar.bz2 dwm-b1701adf75297747c52e0c3ed2c314cd10129907.zip |
new stuff, fixed several issues
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -126,13 +126,14 @@ pipe_spawn(char *buf, unsigned int len, Display *dpy, char *argv[]) perror(" failed"); } else { - n = 0; + l = n = 0; close(pfd[1]); - while(l > n) { + while(n < len) { if((l = read(pfd[0], buf + n, len - n)) < 1) break; n += l; } + while(l > n); close(pfd[0]); buf[n < len ? n : len - 1] = 0; } |