From b1701adf75297747c52e0c3ed2c314cd10129907 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Wed, 12 Jul 2006 17:50:31 +0200 Subject: new stuff, fixed several issues --- util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index 9da8f52b..3f41b3c9 100644 --- a/util.c +++ b/util.c @@ -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; } -- cgit v1.2.3