]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Get rid of some warnings
authorMichael Schroeder <mls@suse.de>
Thu, 12 Jul 2018 14:06:31 +0000 (16:06 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 12 Jul 2018 14:06:31 +0000 (16:06 +0200)
ext/repo_rpmdb_librpm.h
src/selection.c

index 802c5d1c12fe42a05decd52236fdc5e34e2cffb1..60efb07e15826de5aedaa528c4b12649383a76ea 100644 (file)
@@ -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)
     {
 
index d9d35e387d93e744addbdd265e96b0cf840cc77a..c253112865c9bc03003e4e4d61b0b2dc21951f42 100644 (file)
@@ -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;