[hackers] [ubase] mount: style for loop in catfile() || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sat, 05 Apr 2014 19:56:12 +0200

commit acdac112852f822fed95fd6da7f0d3b80fa81af0
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat Apr 5 11:56:40 2014 +0200

    mount: style for loop in catfile()
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/mount.c b/mount.c
index 3953d00..5e0bcff 100644
--- a/mount.c
+++ b/mount.c
_AT_@ -107,9 +107,7 @@ catfile(FILE *in, FILE *out)
         char buf[BUFSIZ];
         size_t bytesread;
 
- while(1) {
- if(feof(in))
- break;
+ while(!feof(in)) {
                 bytesread = fread(buf, 1, sizeof(buf), in);
                 if(ferror(in))
                         return 0;
Received on Sat Apr 05 2014 - 19:56:12 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 05 2014 - 20:00:24 CEST