commit:     89524269b57888bb86a34c6fd7ef0422699fd30b
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 27 07:53:57 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 27 07:53:57 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=89524269

Fix -Wmaybe-uninitialized.

In file included from include_applets.h:13:0,
                 from main.c:1485:
qgrep.c: In function ‘qgrep_main’:
qgrep.c:212:5: warning: ‘dentry’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
  if (*cat_dirent_pt == NULL || *cat_dir_pt == NULL)
     ^
qgrep.c:245:17: note: ‘dentry’ was declared here
  struct dirent *dentry;

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 qgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qgrep.c b/qgrep.c
index 9d2752e..0680035 100644
--- a/qgrep.c
+++ b/qgrep.c
@@ -242,7 +242,7 @@ int qgrep_main(int argc, char **argv)
        DIR *eclass_dir = NULL;
        DIR *vdb_dir = NULL;
        DIR *cat_dir = NULL;
-       struct dirent *dentry;
+       struct dirent *dentry = NULL;
        char ebuild[_Q_PATH_MAX];
        char name[_Q_PATH_MAX];
        char *label;

Reply via email to