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.
This commit is contained in:
Aleksander Morgado
2016-02-13 14:33:12 +01:00
parent 95876c6f57
commit cffba7e0ee

View File

@@ -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) &&