]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: add missing initializer [clang]
authorSami Kerola <kerolasa@iki.fi>
Sun, 28 May 2017 18:06:08 +0000 (19:06 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 14 Jun 2017 10:21:01 +0000 (12:21 +0200)
sys-utils/losetup.c:290:12: warning: variable 'rc' is used uninitialized
whenever 'if' condition is false [-Wsometimes-uninitialized]
sys-utils/losetup.c:293:7: note: uninitialized use occurs here
sys-utils/losetup.c:290:8: note: remove the 'if' if its condition is always true
sys-utils/losetup.c:228:9: note: initialize the variable 'rc' to silence
this warning

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/losetup.c

index e0676c9fd67d80e023759f2d2b31fc4b764ac609..8ed9a1e4bf5eaa88007af6a7dceb20dfc20ec698 100644 (file)
@@ -225,7 +225,7 @@ static int set_scols_data(struct loopdev_cxt *lc, struct libscols_line *ln)
                const char *p = NULL;                   /* external data */
                char *np = NULL;                        /* allocated here */
                uint64_t x = 0;
-               int rc;
+               int rc = 0;
 
                switch(get_column_id(i)) {
                case COL_NAME: