summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 10f113bd24..e1a1168456 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -921,16 +921,9 @@ char *delete_chars(char *s, const char *bad) {
}
bool in_charset(const char *s, const char* charset) {
- const char *i;
-
assert(s);
assert(charset);
-
- for (i = s; *i; i++)
- if (!strchr(charset, *i))
- return false;
-
- return true;
+ return s[strspn(s, charset)] == '\0';
}
char *file_in_same_dir(const char *path, const char *filename) {