From: Karel Zak Date: Thu, 17 Mar 2022 11:22:01 +0000 (+0100) Subject: lib/path: initialize variables for scanf [coverity scan] X-Git-Tag: v2.38~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c941545c7eea09587bec50929b9d6b3d4d5cb045;p=thirdparty%2Futil-linux.git lib/path: initialize variables for scanf [coverity scan] Signed-off-by: Karel Zak --- diff --git a/lib/path.c b/lib/path.c index 20a3ea15d2..42b4eadf16 100644 --- a/lib/path.c +++ b/lib/path.c @@ -815,7 +815,7 @@ int ul_path_readf_s32(struct path_cxt *pc, int *res, const char *path, ...) int ul_path_read_u32(struct path_cxt *pc, unsigned int *res, const char *path) { int rc; - unsigned int x; + unsigned int x = 0; rc = ul_path_scanf(pc, path, "%u", &x); if (rc != 1) @@ -839,7 +839,7 @@ int ul_path_readf_u32(struct path_cxt *pc, unsigned int *res, const char *path, int ul_path_read_majmin(struct path_cxt *pc, dev_t *res, const char *path) { - int rc, maj, min; + int rc, maj = 0, min = 0; rc = ul_path_scanf(pc, path, "%d:%d", &maj, &min); if (rc != 2)