mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-03-24 09:34:04 +00:00
util-strings: drop unused strv_from_argv()
Not used anywhere. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -59,36 +59,6 @@ next_word(const char **state, size_t *len, const char *separators)
|
||||
return next;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a null-terminated string array with the contents of argv
|
||||
* duplicated.
|
||||
*
|
||||
* Use strv_free() to free the array.
|
||||
*
|
||||
* @return A null-terminated string array or NULL on errors
|
||||
*/
|
||||
char**
|
||||
strv_from_argv(int argc, char **argv)
|
||||
{
|
||||
char **strv = NULL;
|
||||
|
||||
assert(argc >= 0);
|
||||
|
||||
if (argc == 0)
|
||||
return NULL;
|
||||
|
||||
strv = zalloc((argc + 1) * sizeof *strv);
|
||||
for (int i = 0; i < argc; i++) {
|
||||
char *copy = safe_strdup(argv[i]);
|
||||
if (!copy) {
|
||||
strv_free(strv);
|
||||
return NULL;
|
||||
}
|
||||
strv[i] = copy;
|
||||
}
|
||||
return strv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a null-terminated string array with the tokens in the input
|
||||
* string, e.g. "one two\tthree" with a separator list of " \t" will return
|
||||
|
||||
@@ -193,7 +193,6 @@ safe_atod(const char *str, double *val)
|
||||
return true;
|
||||
}
|
||||
|
||||
char **strv_from_argv(int argc, char **argv);
|
||||
char **strv_from_string(const char *in, const char *separator, size_t *num_elements);
|
||||
char *strv_join(char **strv, const char *joiner);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user