summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2016-02-13 14:33:12 +0100
committerAleksander Morgado <aleksander@aleksander.es>2016-02-13 14:33:12 +0100
commitcffba7e0ee512800329476d7da13046171c99067 (patch)
tree2e8cbe1c4726767206d6b718a5f7e6ba0a5cd51f
parent95876c6f576875503f20f7e3ad27440bffd9067c (diff)
downloadModemManager-cffba7e0ee512800329476d7da13046171c99067.tar.gz
modem-helpers: regex creation should never fail
We should really consider errors if we expect that the regex string may not compile; but in this case the pattern is fixed, so should never happen.
-rw-r--r--src/mm-modem-helpers.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index ed3657868..78932bafd 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -1343,8 +1343,8 @@ done:
}
/*****************************************************************************/
-
/* AT+CRSM response parser */
+
gboolean
mm_3gpp_parse_crsm_response (const gchar *reply,
guint *sw1,
@@ -1369,9 +1369,8 @@ mm_3gpp_parse_crsm_response (const gchar *reply,
}
r = g_regex_new ("\\+CRSM:\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*\"?([0-9a-fA-F]+)\"?",
- G_REGEX_RAW, 0, error);
- if (!r)
- return FALSE;
+ G_REGEX_RAW, 0, NULL);
+ g_assert (r != NULL);
if (g_regex_match_full (r, reply, strlen (reply), 0, 0, &match_info, NULL) &&
mm_get_uint_from_match_info (match_info, 1, sw1) &&