diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-21 23:12:46 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-21 23:12:46 +0200 |
commit | afc151fae4dd5ddbe6af61e0b5d8ca2cd39295b6 (patch) | |
tree | ddab9c22521bfde8b3a13445eef99c7b3e13de11 | |
parent | a5dda256340000dcd38cc72973c0a2d0dd1e7025 (diff) |
zte: fix regex used when parsing allowed mode response
Also, just g_assert() if regex couldn't be compiled.
-rw-r--r-- | plugins/mm-modem-zte.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/plugins/mm-modem-zte.c b/plugins/mm-modem-zte.c index d089f351..d1ae4713 100644 --- a/plugins/mm-modem-zte.c +++ b/plugins/mm-modem-zte.c @@ -118,13 +118,8 @@ get_allowed_mode_done (MMAtSerialPort *port, goto done; } - r = g_regex_new ("+ZSNT:\\s*(\\d),(\\d),(\\d)", G_REGEX_UNGREEDY, 0, NULL); - if (!r) { - info->error = g_error_new_literal (MM_MODEM_ERROR, - MM_MODEM_ERROR_GENERAL, - "Failed to parse the allowed mode response"); - goto done; - } + r = g_regex_new ("\\+ZSNT:\\s*(\\d),(\\d),(\\d)", G_REGEX_UNGREEDY, 0, NULL); + g_assert (r != NULL); if (g_regex_match_full (r, response->str, response->len, 0, 0, &match_info, &info->error)) { MMModemGsmAllowedMode mode = MM_MODEM_GSM_ALLOWED_MODE_ANY; @@ -776,4 +771,3 @@ mm_modem_zte_class_init (MMModemZteClass *klass) gsm_class->get_allowed_mode = get_allowed_mode; gsm_class->get_access_technology = get_access_technology; } - |