]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: fix compiler warning [-Wuninitialized]
authorKarel Zak <kzak@redhat.com>
Tue, 28 Nov 2017 09:45:06 +0000 (10:45 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Nov 2017 09:45:06 +0000 (10:45 +0100)
sys-utils/dmesg.c: In function ‘print_record.constprop.12’:
sys-utils/dmesg.c:1039:14: warning: ‘mesg_size’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index bdd50b474e419d14d4de36caae7fdbb5ac888cfd..ad47ac44da3382f4b837025310e26ddad18f9a4a 100644 (file)
@@ -883,7 +883,7 @@ static void print_record(struct dmesg_control *ctl,
        char buf[128];
        char fpbuf[32] = "\0";
        char tsbuf[64] = "\0";
-       size_t mesg_size;
+       size_t mesg_size = rec->mesg_size;
        int timebreak = 0;
        char *mesg_copy = NULL;
        const char *line = NULL;