Skip to content

Commit

Permalink
Fixed implicit conversion of NULL to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarmtemp committed Jun 20, 2023
1 parent 7a1593b commit e6ed8a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/daemon/rpmostreed-os.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ search_packages_by_filter (HyQuery query, GVariantBuilder *builder, const gchar
int *keynames, const gchar *id)
{
hy_query_clear (query);
for (guint j = 0; keynames[j] != NULL; j++)
for (guint j = 0; keynames[j] != -1; j++)
{
for (guint i = 0; names[i] != NULL; i++)
{
Expand All @@ -1174,7 +1174,7 @@ search_packages_by_filter (HyQuery query, GVariantBuilder *builder, const gchar
query_results_to_builder (query, builder, id);

hy_query_clear (query);
for (guint j = 0; keynames[j] != NULL; j++)
for (guint j = 0; keynames[j] != -1; j++)
{
for (guint i = 0; names[i] != NULL; i++)
{
Expand Down Expand Up @@ -1211,13 +1211,13 @@ os_handle_search (RPMOSTreeOS *interface, GDBusMethodInvocation *invocation,
GVariantBuilder builder;
g_variant_builder_init (&builder, (const GVariantType *)"aa{sv}");

int keynames_a[3] = { HY_PKG_NAME, HY_PKG_SUMMARY, NULL };
int keynames_a[3] = { HY_PKG_NAME, HY_PKG_SUMMARY, -1 };
search_packages_by_filter (query, &builder, names, keynames_a, "Name & Summary");

int keynames_b[2] = { HY_PKG_NAME, NULL };
int keynames_b[2] = { HY_PKG_NAME, -1 };
search_packages_by_filter (query, &builder, names, keynames_b, "Name");

int keynames_c[2] = { HY_PKG_SUMMARY, NULL };
int keynames_c[2] = { HY_PKG_SUMMARY, -1 };
search_packages_by_filter (query, &builder, names, keynames_c, "Summary");

GVariant *pkgs_result = g_variant_builder_end (&builder);
Expand Down

0 comments on commit e6ed8a3

Please sign in to comment.