libmm-glib,helpers: don't warn when trying to read invalid match info index
We may want to use the mm_get_()_from_match_info() calls to read optional items, so that the method returns FALSE if the item index doesn't apply. So, avoid the implicit warning issued by g_return_val_if_fail().
This commit is contained in:
@@ -1343,7 +1343,8 @@ mm_get_int_from_match_info (GMatchInfo *match_info,
|
||||
gboolean ret;
|
||||
|
||||
s = g_match_info_fetch (match_info, match_index);
|
||||
g_return_val_if_fail (s != NULL, FALSE);
|
||||
if (!s)
|
||||
return FALSE;
|
||||
|
||||
ret = mm_get_int_from_str (s, out);
|
||||
g_free (s);
|
||||
@@ -1394,7 +1395,8 @@ mm_get_uint_from_match_info (GMatchInfo *match_info,
|
||||
gboolean ret;
|
||||
|
||||
s = g_match_info_fetch (match_info, match_index);
|
||||
g_return_val_if_fail (s != NULL, FALSE);
|
||||
if (!s)
|
||||
return FALSE;
|
||||
|
||||
ret = mm_get_uint_from_str (s, out);
|
||||
g_free (s);
|
||||
@@ -1439,7 +1441,8 @@ mm_get_double_from_match_info (GMatchInfo *match_info,
|
||||
gboolean ret;
|
||||
|
||||
s = g_match_info_fetch (match_info, match_index);
|
||||
g_return_val_if_fail (s != NULL, FALSE);
|
||||
if (!s)
|
||||
return FALSE;
|
||||
|
||||
ret = mm_get_double_from_str (s, out);
|
||||
g_free (s);
|
||||
|
Reference in New Issue
Block a user