summaryrefslogtreecommitdiffstats
path: root/src/stk.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-12-10 09:25:02 -0600
committerDenis Kenzior <denkenz@gmail.com>2010-12-10 10:46:56 -0600
commit772bee27d4ae0c8acf3ed8e93b3a9c71190635e9 (patch)
tree34ce3a959dc9f1b9f4be26d7dc7120cd220d913c /src/stk.c
parent778302a1e58dcbbcf1d47607f28d1b112b96caea (diff)
downloadofono-772bee27d4ae0c8acf3ed8e93b3a9c71190635e9.tar.bz2
stk: No need to check for null text
For Set up idle mode text
Diffstat (limited to 'src/stk.c')
-rw-r--r--src/stk.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/stk.c b/src/stk.c
index 5ded9ee2..09229cea 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -520,7 +520,7 @@ static DBusMessage *stk_get_properties(DBusConnection *conn,
OFONO_PROPERTIES_ARRAY_SIGNATURE,
&dict);
- str = stk->idle_mode_text ? stk->idle_mode_text : "";
+ str = stk->idle_mode_text;
ofono_dbus_dict_append(&dict, "IdleModeText", DBUS_TYPE_STRING, &str);
icon = stk->idle_mode_icon.id;
@@ -873,17 +873,15 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
{
DBusConnection *conn = ofono_dbus_get_connection();
const char *path = __ofono_atom_get_path(stk->atom);
- char *idle_mode_text = NULL;
+ char *idle_mode_text;
- if (cmd->setup_idle_mode_text.text) {
- idle_mode_text = dbus_apply_text_attributes(
+ idle_mode_text = dbus_apply_text_attributes(
cmd->setup_idle_mode_text.text,
&cmd->setup_idle_mode_text.text_attr);
- if (idle_mode_text == NULL) {
- rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
- return TRUE;
- }
+ if (idle_mode_text == NULL) {
+ rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
+ return TRUE;
}
if (stk->idle_mode_text)
@@ -891,7 +889,6 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
stk->idle_mode_text = idle_mode_text;
- idle_mode_text = idle_mode_text ? idle_mode_text : "";
ofono_dbus_signal_property_changed(conn, path, OFONO_STK_INTERFACE,
"IdleModeText",
DBUS_TYPE_STRING,
@@ -2655,10 +2652,8 @@ static void stk_unregister(struct ofono_atom *atom)
stk->cancel_cmd = NULL;
}
- if (stk->idle_mode_text) {
- g_free(stk->idle_mode_text);
- stk->idle_mode_text = NULL;
- }
+ g_free(stk->idle_mode_text);
+ stk->idle_mode_text = NULL;
if (stk->timers_source) {
g_source_remove(stk->timers_source);