flag_to_string could returns NULL
authorTomas Mlcoch <tmlcoch@redhat.com>
Wed, 20 Jun 2012 12:07:35 +0000 (14:07 +0200)
committerTomas Mlcoch <tmlcoch@redhat.com>
Mon, 25 Jun 2012 10:41:36 +0000 (12:41 +0200)
src/misc.c
src/parsehdr.c

index 5792015..40f37d2 100644 (file)
@@ -43,7 +43,7 @@ const char *flag_to_string(gint64 flags)
     flags &= 0xf;
     switch(flags) {
         case 0:
-            return "";
+            return NULL;
         case 2:
             return "LT";
         case 4:
@@ -55,7 +55,7 @@ const char *flag_to_string(gint64 flags)
         case 12:
             return "GE";
         default:
-            return "";
+            return NULL;
     }
 }
 
index 209e379..c519db3 100644 (file)
@@ -285,7 +285,7 @@ Package *parse_header(Header hdr, gint64 mtime, gint64 size, const char *checksu
                     gpointer value;
                     if (g_hash_table_lookup_extended(ap_hashtable, filename, NULL, &value)) {
                         struct ap_value_struct *ap_value = value;
-                        if (!strcmp(ap_value->flags, flags) &&
+                        if (!g_strcmp0(ap_value->flags, flags) &&
                             !strcmp(ap_value->version, full_version) &&
                             (ap_value->pre == pre))
                         {