[hackers] [sbase] build warnings: initialise values... || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Mon, 12 May 2014 13:06:19 +0200

commit 5b3a0a9382e41c1129e1fc64ebdd877eb7179952
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon May 12 11:01:47 2014 +0000

    build warnings: initialise values...
    
    ... to make fix gcc warnings with -Wall.
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/split.c b/split.c
index c91865e..638af54 100644
--- a/split.c
+++ b/split.c
_AT_@ -27,9 +27,9 @@ main(int argc, char *argv[])
         char *prefix = "x";
         char *file = NULL;
         char *tmp, *end;
- uint64_t size = 1000, scale, n;
+ uint64_t size = 1000, scale = 1, n;
         int always = 0;
- FILE *in=stdin, *out=NULL;
+ FILE *in = stdin, *out = NULL;
 
         ARGBEGIN {
         case 'b':
diff --git a/xargs.c b/xargs.c
index ada00b6..c80c524 100644
--- a/xargs.c
+++ b/xargs.c
_AT_@ -40,9 +40,9 @@ usage(void)
 int
 main(int argc, char *argv[])
 {
- int leftover;
+ int leftover = 0;
         long argsz, argmaxsz;
- char *arg;
+ char *arg = "";
         int i, a;
 
         ARGBEGIN {
_AT_@ -67,7 +67,6 @@ main(int argc, char *argv[])
         /* Leave some room for environment variables */
         argmaxsz -= 4 * 1024;
 
- leftover = 0;
         do {
                 argsz = 0; i = 0; a = 0;
                 if (argc > 0) {
Received on Mon May 12 2014 - 13:06:19 CEST

This archive was generated by hypermail 2.3.0 : Mon May 12 2014 - 13:12:28 CEST