dwm-meillo

diff util.c @ 30:2e0fb4130bfb

new stuff, fixed several issues
author Anselm R. Garbe <garbeam@wmii.de>
date Wed, 12 Jul 2006 17:50:31 +0200
parents 359b6e563b95
children 082c75b937b5
line diff
     1.1 --- a/util.c	Wed Jul 12 17:17:15 2006 +0200
     1.2 +++ b/util.c	Wed Jul 12 17:50:31 2006 +0200
     1.3 @@ -126,13 +126,14 @@
     1.4  		perror(" failed");
     1.5  	}
     1.6  	else {
     1.7 -		n = 0;
     1.8 +		l = n = 0;
     1.9  		close(pfd[1]);
    1.10 -		while(l > n) {
    1.11 +		while(n < len) {
    1.12  			if((l = read(pfd[0], buf + n, len - n)) < 1)
    1.13  				break;
    1.14  			n += l;
    1.15  		}
    1.16 +		while(l > n);
    1.17  		close(pfd[0]);
    1.18  		buf[n < len ? n : len - 1] = 0;
    1.19  	}