diff options
author | Ben Chan <benchan@chromium.org> | 2019-07-10 12:29:40 -0700 |
---|---|---|
committer | Ben Chan <benchan@chromium.org> | 2019-07-10 14:48:22 -0700 |
commit | 8d8b3a722aaeac5ba0e3b735b63e39bb007eee23 (patch) | |
tree | 0267ac6801403d4dd5f42f15e12788ea3d136b36 /plugins/cinterion/mm-modem-helpers-cinterion.c | |
parent | ea93aad8a414a3cdcf6864649e09e3bdf9ac4e5d (diff) |
misc: use g_regex_match() for simplicity
This CL converts a few g_regex_match_full() expressions to their
equivalent g_regex_match() in order to simplify the code, i.e.
g_regex_match_full (regex, str, strlen (str), 0, 0, &match_info, NULL)
is equivalent to:
g_regex_match_full (regex, str, -1, 0, 0, &match_info, NULL)
or simply:
g_regex_match (regex, str, 0, &match_info)
Diffstat (limited to 'plugins/cinterion/mm-modem-helpers-cinterion.c')
-rw-r--r-- | plugins/cinterion/mm-modem-helpers-cinterion.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.c b/plugins/cinterion/mm-modem-helpers-cinterion.c index 2afd11a4..c7b0c44d 100644 --- a/plugins/cinterion/mm-modem-helpers-cinterion.c +++ b/plugins/cinterion/mm-modem-helpers-cinterion.c @@ -201,7 +201,7 @@ mm_cinterion_parse_scfg_response (const gchar *response, r = g_regex_new ("\\^SCFG:\\s*\"Radio/Band\",\\s*\"?([0-9a-fA-F]*)\"?", 0, 0, NULL); g_assert (r != NULL); - if (g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, NULL)) { + if (g_regex_match (r, response, 0, &match_info)) { gchar *currentstr; guint current = 0; @@ -441,7 +441,7 @@ mm_cinterion_parse_sind_response (const gchar *response, r = g_regex_new ("\\^SIND:\\s*(.*),(\\d+),(\\d+)(\\r\\n)?", 0, 0, NULL); g_assert (r != NULL); - if (g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, NULL)) { + if (g_regex_match (r, response, 0, &match_info)) { if (description) { *description = mm_get_string_unquoted_from_match_info (match_info, 1); if (*description == NULL) |