From f09852bc193cde643d467eb214ae41bac8c49aab Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 18 Jan 2023 19:47:09 +0100 Subject: [PATCH] mm-origin: Prefer STR_IS_NULL_OR_EMPTY macro to explicit checks --- plugins/provider/mm/calls-mm-origin.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/provider/mm/calls-mm-origin.c b/plugins/provider/mm/calls-mm-origin.c index 4bda1d4..71d36aa 100644 --- a/plugins/provider/mm/calls-mm-origin.c +++ b/plugins/provider/mm/calls-mm-origin.c @@ -29,6 +29,7 @@ #include "calls-ussd.h" #include "calls-mm-call.h" #include "calls-message-source.h" +#include "calls-util.h" #include "itu-e212-iso.h" #include @@ -215,7 +216,7 @@ calls_mm_ussd_initiate_async (CallsUssd *ussd, return; } - if (!command || !*command) { + if (STR_IS_NULL_OR_EMPTY (command)) { g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "USSD command empty"); return; @@ -718,10 +719,10 @@ ussd_properties_changed_cb (CallsMMOrigin *self, (value = g_variant_lookup_value (properties, "NetworkRequest", NULL))) { response = mm_modem_3gpp_ussd_get_network_request (self->ussd); - if (response && *response && response != self->last_ussd_request) + if (!STR_IS_NULL_OR_EMPTY (response) && response != self->last_ussd_request) g_signal_emit_by_name (self, "ussd-added", response); - if (response && *response) + if (!STR_IS_NULL_OR_EMPTY (response)) self->last_ussd_request = (char *) response; g_clear_pointer (&value, g_variant_unref); } @@ -730,10 +731,10 @@ ussd_properties_changed_cb (CallsMMOrigin *self, (value = g_variant_lookup_value (properties, "NetworkNotification", NULL))) { response = mm_modem_3gpp_ussd_get_network_notification (self->ussd); - if (response && *response && response != self->last_ussd_response) + if (!STR_IS_NULL_OR_EMPTY (response) && response != self->last_ussd_response) g_signal_emit_by_name (self, "ussd-added", response); - if (response && *response) + if (!STR_IS_NULL_OR_EMPTY (response)) self->last_ussd_response = (char *) response; g_clear_pointer (&value, g_variant_unref); }