aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/mm-common-helpers.c9
-rw-r--r--libmm-glib/mm-common-helpers.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c
index b443f1ab..3a97e3be 100644
--- a/libmm-glib/mm-common-helpers.c
+++ b/libmm-glib/mm-common-helpers.c
@@ -1688,6 +1688,7 @@ mm_utils_hex2byte (const gchar *hex)
gchar *
mm_utils_hexstr2bin (const gchar *hex,
+ gssize len,
gsize *out_len,
GError **error)
{
@@ -1695,10 +1696,10 @@ mm_utils_hexstr2bin (const gchar *hex,
g_autofree gchar *buf = NULL;
gsize i;
gint a;
- gchar *opos;
- gsize len;
-
- len = strlen (hex);
+ gchar *opos
+;
+ if (len < 0)
+ len = strlen (hex);
/* Length must be a multiple of 2 */
if ((len % 2) != 0) {
diff --git a/libmm-glib/mm-common-helpers.h b/libmm-glib/mm-common-helpers.h
index d3cf62d7..50d58134 100644
--- a/libmm-glib/mm-common-helpers.h
+++ b/libmm-glib/mm-common-helpers.h
@@ -181,7 +181,7 @@ gchar *mm_get_string_unquoted_from_match_info (GMatchInfo *match_info,
const gchar *mm_sms_delivery_state_get_string_extended (guint delivery_state);
gint mm_utils_hex2byte (const gchar *hex);
-gchar *mm_utils_hexstr2bin (const gchar *hex, gsize *out_len, GError **error);
+gchar *mm_utils_hexstr2bin (const gchar *hex, gssize len, gsize *out_len, GError **error);
gchar *mm_utils_bin2hexstr (const guint8 *bin, gsize len);
gboolean mm_utils_ishexstr (const gchar *hex);