summaryrefslogtreecommitdiff
path: root/src/glib-utils.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-01-31 11:31:56 +0100
committerZenWalker <[email protected]>2020-03-08 21:14:36 +0100
commit144ac2fb1395a76a04773c577965a8754f2dab3b (patch)
tree61820c300316ed7b1893160b53f0f4b7ae5c408e /src/glib-utils.c
parent3c6c1cef810b6a27ecf5142893bd960d6efb32f2 (diff)
downloadengrampa-144ac2fb1395a76a04773c577965a8754f2dab3b.tar.bz2
engrampa-144ac2fb1395a76a04773c577965a8754f2dab3b.tar.xz
glib-utils: remove n_fields function
Diffstat (limited to 'src/glib-utils.c')
-rw-r--r--src/glib-utils.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/glib-utils.c b/src/glib-utils.c
index cffa591..ed42dd7 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -378,7 +378,7 @@ search_util_get_regexps (const char *pattern_string,
if (patterns == NULL)
return NULL;
- regexps = g_new0 (GRegex*, n_fields (patterns) + 1);
+ regexps = g_new0 (GRegex*, g_strv_length (patterns) + 1);
for (i = 0; patterns[i] != NULL; i++)
regexps[i] = g_regex_new (patterns[i],
G_REGEX_OPTIMIZE | compile_options,
@@ -452,21 +452,6 @@ get_last_field (const char *line,
}
-int
-n_fields (char **str_array)
-{
- int i;
-
- if (str_array == NULL)
- return 0;
-
- i = 0;
- while (str_array[i] != NULL)
- i++;
- return i;
-}
-
-
void
debug (const char *file,
int line,