[systemd-devel] [PATCH 3/3] sysusers: Remove some gcc warnings about uninitialized variables

philippedeswert at gmail.com philippedeswert at gmail.com
Thu Sep 18 08:56:57 PDT 2014


From: Philippe De Swert <philippedeswert at gmail.com>

Gcc is spewing some warnings about uninitialized variables.
Let's get rid of the noise.
---
 src/sysusers/sysusers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index ba20d94..4203b3e 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -796,8 +796,8 @@ static int root_stat(const char *p, struct stat *st) {
 static int read_id_from_file(Item *i, uid_t *_uid, gid_t *_gid) {
         struct stat st;
         bool found_uid = false, found_gid = false;
-        uid_t uid;
-        gid_t gid;
+        uid_t uid = 0;
+        gid_t gid = 0;
 
         assert(i);
 
-- 
1.8.3.2



More information about the systemd-devel mailing list