[hackers] [sbase] cmp: fix missing braces || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Tue, 01 Apr 2014 17:21:10 +0200

commit eee182cdd74a1348b9dfb8bce0016b32543f706a
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Tue Apr 1 16:55:37 2014 +0200

    cmp: fix missing braces
    
    just a style fix, this doesn't change any behaviour since fp[1] is set to stdin above.
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/cmp.c b/cmp.c
index e3ba852..c130429 100644
--- a/cmp.c
+++ b/cmp.c
_AT_@ -42,10 +42,10 @@ main(int argc, char *argv[])
                 enprintf(Error, "fopen %s:", argv[0]);
         fp[1] = stdin;
 
- if (argc == 2)
- fp[1] = fopen(argv[1], "r");
- if (!fp[1])
+ if (argc == 2) {
+ if(!(fp[1] = fopen(argv[1], "r")))
                         enprintf(Error, "fopen %s:", argv[1]);
+ }
 
         for(n = 1; ; n++) {
                 b[0] = getc(fp[0]);
Received on Tue Apr 01 2014 - 17:21:10 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 01 2014 - 17:24:41 CEST