summaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-11-22 17:01:19 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-23 11:35:11 +0000
commit657cabcfce6794d2a2f629d63dbd56fc149dab2e (patch)
tree402bd1b6787ee65b93aad0d1b94ef9e9162e2178 /src/mm-modem-helpers.c
parentdbdf67e9f7c55d7f70ed94449160a7ff254359a2 (diff)
downloadModemManager-657cabcfce6794d2a2f629d63dbd56fc149dab2e.tar.gz
libmm-glib,common-helpers: make hexstr2bin() return a GError
This util method checks whether the input string is a valid hex string, so make sure we return a GError on failure.
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r--src/mm-modem-helpers.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 3ee12aaa7..a2fb07fa4 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -4291,10 +4291,9 @@ mm_3gpp_parse_emergency_numbers (const char *raw, GError **error)
return NULL;
}
- bin = (guint8 *) mm_utils_hexstr2bin (raw, &binlen);
+ bin = (guint8 *) mm_utils_hexstr2bin (raw, &binlen, error);
if (!bin) {
- g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
- "invalid raw emergency numbers list contents: %s", raw);
+ g_prefix_error (error, "invalid raw emergency numbers list contents: ");
return NULL;
}