aboutsummarylogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorAnselm R. Garbe2006-07-12 17:50:31 +0200
committerAnselm R. Garbe2006-07-12 17:50:31 +0200
commitc89171fef89cbadd3b0579398ad812059f67ad44 (patch)
treede827703252f5fe704c6634ac6fe1dbcdae54a7b /util.c
parente18ea3c8d11abcb2993ca72e3cd20792b005986a (diff)
downloadaur-c89171fef89cbadd3b0579398ad812059f67ad44.tar.gz
new stuff, fixed several issues
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index 9da8f52b58cb..3f41b3c9e846 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;
}