tree-wide: add global ascii_isdigit() + ascii_isalpha()

We now have a local implementation in string-util-fundamental.c, but
it's useful at a lot of other places, hence let's give it a more
expressive name and share it across the tree.

Follow-up for: 8d9156660d
This commit is contained in:
Lennart Poettering
2022-07-05 14:25:07 +02:00
parent 82c3a0b74c
commit ff25d3385d
25 changed files with 68 additions and 89 deletions
+2 -4
View File
@@ -75,10 +75,8 @@ int gethostname_full(GetHostnameFlags flags, char **ret) {
bool valid_ldh_char(char c) {
/* "LDH" → "Letters, digits, hyphens", as per RFC 5890, Section 2.3.1 */
return
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
return ascii_isalpha(c) ||
ascii_isdigit(c) ||
c == '-';
}