aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/mm-common-helpers.c10
-rw-r--r--libmm-glib/mm-common-helpers.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c
index 0245fd52..43fff922 100644
--- a/libmm-glib/mm-common-helpers.c
+++ b/libmm-glib/mm-common-helpers.c
@@ -1686,18 +1686,18 @@ mm_utils_hex2byte (const gchar *hex)
return (a << 4) | b;
}
-gchar *
+guint8 *
mm_utils_hexstr2bin (const gchar *hex,
gssize len,
gsize *out_len,
GError **error)
{
const gchar *ipos = hex;
- g_autofree gchar *buf = NULL;
+ g_autofree guint8 *buf = NULL;
gsize i;
gint a;
- gchar *opos
-;
+ guint8 *opos;
+
if (len < 0)
len = strlen (hex);
@@ -1723,7 +1723,7 @@ mm_utils_hexstr2bin (const gchar *hex,
ipos[0], ipos[1]);
return NULL;
}
- *opos++ = a;
+ *opos++ = (guint8)a;
ipos += 2;
}
*out_len = len / 2;
diff --git a/libmm-glib/mm-common-helpers.h b/libmm-glib/mm-common-helpers.h
index 50d58134..4e6d9784 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, gssize len, gsize *out_len, GError **error);
+guint8 *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);