From 0e1482917ac682195da14194450e561ccdba10d9 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 27 Dec 2019 10:53:10 +0100 Subject: [PATCH] Fix maybe-uninitialized warnings detected by LTO. --- bin/xbps-dgraph/main.c | 2 +- lib/package_alternatives.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/xbps-dgraph/main.c b/bin/xbps-dgraph/main.c index b1acb2c7..8c3c1ccf 100644 --- a/bin/xbps-dgraph/main.c +++ b/bin/xbps-dgraph/main.c @@ -263,7 +263,7 @@ parse_array_in_pkg_dictionary(FILE *f, xbps_dictionary_t plistd, { xbps_dictionary_keysym_t dksym; xbps_object_t keyobj, sub_keyobj; - const char *tmpkeyname, *cfprop; + const char *tmpkeyname, *cfprop = NULL; char *keyname; for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) { diff --git a/lib/package_alternatives.c b/lib/package_alternatives.c index ecdc40ae..702a88c9 100644 --- a/lib/package_alternatives.c +++ b/lib/package_alternatives.c @@ -410,8 +410,9 @@ xbps_alternatives_unregister(struct xbps_handle *xhp, xbps_dictionary_t pkgd) */ static void prune_altgroup(struct xbps_handle *xhp, xbps_dictionary_t repod, - char *pkgname, const char *pkgver, const char *keyname) { - const char *newpkg, *curpkg; + char *pkgname, const char *pkgver, const char *keyname) +{ + const char *newpkg = NULL, *curpkg = NULL; xbps_array_t array; xbps_dictionary_t alternatives; xbps_string_t kstr; @@ -560,7 +561,7 @@ xbps_alternatives_register(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod) for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) { xbps_array_t array; xbps_object_t keysym; - const char *keyname, *first; + const char *keyname, *first = NULL; keysym = xbps_array_get(allkeys, i); keyname = xbps_dictionary_keysym_cstring_nocopy(keysym);