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:
@@ -1411,9 +1411,8 @@ int verify_timezone(const char *name, int log_level) {
|
||||
return -EINVAL;
|
||||
|
||||
for (p = name; *p; p++) {
|
||||
if (!(*p >= '0' && *p <= '9') &&
|
||||
!(*p >= 'a' && *p <= 'z') &&
|
||||
!(*p >= 'A' && *p <= 'Z') &&
|
||||
if (!ascii_isdigit(*p) &&
|
||||
!ascii_isalpha(*p) &&
|
||||
!IN_SET(*p, '-', '_', '+', '/'))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user