ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit a707baffd6c5d2a7af15fe5c1850a1c4a03465b9
parent f9a9d4d8fc6687a188110bd6a809dc48695347ed
Author: sin <sin@2f30.org>
Date:   Mon, 14 Apr 2014 14:52:16 +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.

Diffstat:
Mtruncate.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/truncate.c b/truncate.c @@ -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': @@ -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++) {