diff options
author | Denis Kenzior <denkenz@gmail.com> | 2018-12-22 16:00:19 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2018-12-27 18:18:51 -0600 |
commit | 4059d4226bc4cf9afac361db5d52fa6c2b20249d (patch) | |
tree | 58a4b8cbbe76bddea173ae473c4d7a876d3c3042 /src/sim.c | |
parent | 44415e754b4606043c9975cb56eb66e945067ed2 (diff) | |
download | ofono-4059d4226bc4cf9afac361db5d52fa6c2b20249d.tar.gz |
util: Switch character conversions to ell
Switch various conversions from GSM/UCS2 to UTF8 from glib based
implementation over to ell.
This also converts all related g_free calls to l_free calls (though in
the end they are equivalent calls to free)
Diffstat (limited to 'src/sim.c')
-rw-r--r-- | src/sim.c | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -36,6 +36,8 @@ #include <errno.h> #include <unistd.h> +#include <ell/ell.h> + #include "ofono.h" #include "common.h" @@ -349,8 +351,8 @@ static char **get_service_numbers(GSList *service_numbers) static void service_number_free(gpointer pointer) { struct service_number *num = pointer; - g_free(num->id); - g_free(num); + l_free(num->id); + l_free(num); } static void call_state_watches(struct ofono_sim *sim) @@ -1285,27 +1287,26 @@ static void sim_sdn_read_cb(int ok, int length, int record, if (sim_adn_parse(data, record_length, &ph, &alpha) == FALSE) goto out; - /* Use phone number if Id is unavailable */ if (alpha && alpha[0] == '\0') { - g_free(alpha); + l_free(alpha); alpha = NULL; } if (alpha == NULL) - alpha = g_strdup(phone_number_to_string(&ph)); + alpha = l_strdup(phone_number_to_string(&ph)); if (sim->service_numbers && g_slist_find_custom(sim->service_numbers, alpha, service_number_compare)) { ofono_error("Duplicate EFsdn entries for `%s'", alpha); - g_free(alpha); + l_free(alpha); goto out; } - sdn = g_new(struct service_number, 1); + sdn = l_new(struct service_number, 1); sdn->id = alpha; memcpy(&sdn->ph, &ph, sizeof(struct ofono_phone_number)); @@ -2512,10 +2513,10 @@ static void sim_spn_close(struct ofono_sim *sim) sim->reading_spn = false; - g_free(sim->spn); + l_free(sim->spn); sim->spn = NULL; - g_free(sim->spn_dc); + l_free(sim->spn_dc); sim->spn_dc = NULL; } @@ -2829,10 +2830,10 @@ static void sim_spn_set(struct ofono_sim *sim, const void *data, int length, DBusConnection *conn = ofono_dbus_get_connection(); const char *path = __ofono_atom_get_path(sim->atom); - g_free(sim->spn); + l_free(sim->spn); sim->spn = NULL; - g_free(sim->spn_dc); + l_free(sim->spn_dc); sim->spn_dc = NULL; if (data == NULL) @@ -2861,13 +2862,13 @@ static void sim_spn_set(struct ofono_sim *sim, const void *data, int length, } if (strlen(sim->spn) == 0) { - g_free(sim->spn); + l_free(sim->spn); sim->spn = NULL; goto notify; } if (dc) - sim->spn_dc = g_memdup(dc, 1); + sim->spn_dc = l_memdup(dc, 1); notify: if (sim->spn) |