From: Michael Schroeder Date: Thu, 12 Jul 2018 14:06:31 +0000 (+0200) Subject: Get rid of some warnings X-Git-Tag: 0.6.35~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=764615dbfc5edd3719b7e4cdee4f53f892c0a9e3;p=thirdparty%2Flibsolv.git Get rid of some warnings --- diff --git a/ext/repo_rpmdb_librpm.h b/ext/repo_rpmdb_librpm.h index 802c5d1c..60efb07e 100644 --- a/ext/repo_rpmdb_librpm.h +++ b/ext/repo_rpmdb_librpm.h @@ -125,15 +125,15 @@ getinstalledrpmdbids(struct rpmdbstate *state, const char *index, const char *ma rpmdbIndexIterator ii; int i; + *nentriesp = 0; + if (namedatap) + *namedatap = 0; + if (state->dbenvopened != 1 && !opendbenv(state)) return 0; ii = rpmdbIndexIteratorInit(rpmtsGetRdb(state->ts), RPMDBI_NAME); - *nentriesp = 0; - if (namedatap) - *namedatap = 0; - while (rpmdbIndexIteratorNext(ii, &key, &keylen) == 0) { diff --git a/src/selection.c b/src/selection.c index d9d35e38..c2531128 100644 --- a/src/selection.c +++ b/src/selection.c @@ -1383,6 +1383,8 @@ setup_limiter(Pool *pool, int flags, struct limiter *limiter) static int matchdep_str(const char *pattern, const char *string, int flags) { + if (!pattern || !string) + return 0; if (flags & SELECTION_GLOB) { int globflags = (flags & SELECTION_NOCASE) != 0 ? FNM_CASEFOLD : 0;