]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: fix cppcheck warning [Uninitialized variable]
authorKarel Zak <kzak@redhat.com>
Wed, 18 Aug 2021 08:19:23 +0000 (10:19 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Aug 2021 08:19:23 +0000 (10:19 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu-cputype.c

index 3c162c6c2b847b5ba424600280cdf0ae3077682d..c53bb8e24a138ffc4b0e1ec0a8ed1427180bd077 100644 (file)
@@ -321,7 +321,7 @@ static char *key_cleanup(char *str, int *keynum)
 
 static const struct cpuinfo_pattern *cpuinfo_parse_line(char *str, char **value, int *keynum)
 {
-       struct cpuinfo_pattern key, *pat;
+       struct cpuinfo_pattern key = { .id = 0 }, *pat;
        char *p, *v;
        char buf[CPUTYPE_PATTERN_BUFSZ] = { 0 };