Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
trivial: fix up two runtime critical warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsie committed Apr 20, 2010
1 parent 30e1055 commit b2c0b12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion libzif/zif-md-filelists-xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,20 @@ zif_md_filelists_xml_search_file (ZifMd *md, gchar **search,
zif_completion_done (completion);
}

/* create results array */
array = g_ptr_array_new_with_free_func (g_free);

/* no entries, so shortcut */
if (md_filelists->priv->array->len == 0) {
zif_completion_done (completion);
goto out;
}

/* setup steps */
completion_local = zif_completion_get_child (completion);
zif_completion_set_number_steps (completion_local, md_filelists->priv->array->len);

/* search array */
array = g_ptr_array_new_with_free_func (g_free);
packages = md_filelists->priv->array;
for (i=0; i<packages->len; i++) {
package = g_ptr_array_index (packages, i);
Expand Down
4 changes: 3 additions & 1 deletion libzif/zif-md-primary-sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ zif_md_primary_sql_get_statement_for_pred (const gchar *pred, gchar **search)
g_string_append (statement, " OR ");
g_free (temp);
}
if (i % max_items != max_items - 1) {

/* remove trailing OR entry */
if (g_str_has_suffix (statement->str, " OR ")) {
g_string_set_size (statement, statement->len - 4);
g_string_append (statement, ";\n");
}
Expand Down

0 comments on commit b2c0b12

Please sign in to comment.