[hackers] [ubase] Initialize size to 0 to avoid gcc warnings || sin

From: <git_AT_suckless.org>
Date: Mon, 14 Apr 2014 15:53:44 +0200

commit a707baffd6c5d2a7af15fe5c1850a1c4a03465b9
Author: sin <sin_AT_2f30.org>
Date: Mon Apr 14 14:52:16 2014 +0100

    Initialize size to 0 to avoid gcc warnings
    
    We can never get to a call to ftruncate() without specifying size
    so the compiler warning is bogus.

diff --git a/truncate.c b/truncate.c
index b34fd9a..f19d99f 100644
--- a/truncate.c
+++ b/truncate.c
_AT_@ -19,7 +19,7 @@ main(int argc, char *argv[])
 {
         int cflag = 0, sflag = 0;
         int fd, i, ret = EXIT_SUCCESS;
- long size;
+ long size = 0;
 
         ARGBEGIN {
         case 's':
_AT_@ -33,7 +33,7 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
- if (argc < 1 || !sflag)
+ if (argc < 1 || sflag == 0)
                 usage();
 
         for (i = 0; i < argc; i++) {
Received on Mon Apr 14 2014 - 15:53:44 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 14 2014 - 16:00:33 CEST