util: move string_is_safe() to string-util.[ch]

This commit is contained in:
Lennart Poettering
2015-10-27 13:25:56 +01:00
parent f4f15635ec
commit f3e2e81d53
4 changed files with 19 additions and 19 deletions
-17
View File
@@ -886,23 +886,6 @@ bool in_initrd(void) {
return saved;
}
bool string_is_safe(const char *p) {
const char *t;
if (!p)
return false;
for (t = p; *t; t++) {
if (*t > 0 && *t < ' ')
return false;
if (strchr("\\\"\'\x7f", *t))
return false;
}
return true;
}
/* hey glibc, APIs with callbacks without a user pointer are so useless */
void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
int (*compar) (const void *, const void *, void *), void *arg) {