From 7780f3c786969e19d865afb3ee7555faf4137fef Mon Sep 17 00:00:00 2001 From: Sudhakar Verma Date: Fri, 26 Jul 2024 15:52:33 +0530 Subject: [PATCH 1/2] sysprof: remove redundant NULL check --- src/sysprof/sysprof-dbus-section.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sysprof/sysprof-dbus-section.c b/src/sysprof/sysprof-dbus-section.c index 3863a7d8..ab59e52e 100644 --- a/src/sysprof/sysprof-dbus-section.c +++ b/src/sysprof/sysprof-dbus-section.c @@ -92,9 +92,6 @@ flags_to_string (GType type, if (!(flags_class = g_type_class_ref (type))) return NULL; - if (flags_class == NULL) - return NULL; - str = g_string_new (NULL); while ((str->len == 0 || value != 0) && From bfe55f46b2e30277ed5c5b395abeb111b36dbfdb Mon Sep 17 00:00:00 2001 From: Sudhakar Verma Date: Fri, 26 Jul 2024 16:58:21 +0530 Subject: [PATCH 2/2] libsysprof: fix size to copy --- src/libsysprof/sysprof-battery-charge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsysprof/sysprof-battery-charge.c b/src/libsysprof/sysprof-battery-charge.c index 348c57f5..28952294 100644 --- a/src/libsysprof/sysprof-battery-charge.c +++ b/src/libsysprof/sysprof-battery-charge.c @@ -169,7 +169,7 @@ sysprof_battery_charge_record_fiber (gpointer user_data) counter->id = ids[n_counters] = sysprof_capture_writer_request_counter (writer, 1); counter->type = SYSPROF_CAPTURE_COUNTER_INT64; - g_strlcpy (counter->category, "Battery Charge", sizeof counter->description); + g_strlcpy (counter->category, "Battery Charge", sizeof counter->category); if (g_file_get_contents (model_name_path, &model_name_data, NULL, NULL)) g_strlcpy (counter->name, g_strstrip (model_name_data), sizeof counter->name); else