From f587fa1535d99d95d6b4e909d263e52e59133b32 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 15 Mar 2012 08:56:12 -0400 Subject: [PATCH] Quiet a gcc "used uninitialized in this function" false positive. --- compat/pw_dup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compat/pw_dup.c b/compat/pw_dup.c index ec5659982..f43153e8b 100644 --- a/compat/pw_dup.c +++ b/compat/pw_dup.c @@ -62,12 +62,12 @@ do { \ struct passwd * pw_dup(const struct passwd *pw) { - char *cp; - size_t nsize, psize, gsize, dsize, ssize, total; + size_t nsize = 0, psize = 0, gsize = 0, dsize = 0, ssize = 0, total; #ifdef HAVE_LOGIN_CAP_H - size_t csize; + size_t csize; #endif - struct passwd *newpw; + struct passwd *newpw; + char *cp; /* Allocate in one big chunk for easy freeing */ total = sizeof(struct passwd); @@ -81,7 +81,7 @@ pw_dup(const struct passwd *pw) PW_SIZE(pw_shell, ssize); if ((cp = malloc(total)) == NULL) - return (NULL); + return NULL; newpw = (struct passwd *)cp; /* -- 2.40.0