diff options
Diffstat (limited to 'libmm-glib/mm-common-helpers.c')
-rw-r--r-- | libmm-glib/mm-common-helpers.c | 9 |
1 files changed, 5 insertions, 4 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) { |