diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-07-05 11:55:26 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-07-05 14:25:07 +0200 |
commit | ff25d3385dfbf493c878c9e227df56db3dc10b6a (patch) | |
tree | a4302f4eb82e157abfa94c3045a65abeafdbb3af /src/shared/device-nodes.c | |
parent | sd-id128: don't allow chars > f in valid id128 values (diff) | |
download | systemd-ff25d3385dfbf493c878c9e227df56db3dc10b6a.tar.xz systemd-ff25d3385dfbf493c878c9e227df56db3dc10b6a.zip |
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: 8d9156660d6958c8d63b1d44692968f1b5d33920
Diffstat (limited to 'src/shared/device-nodes.c')
-rw-r--r-- | src/shared/device-nodes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/device-nodes.c b/src/shared/device-nodes.c index ec5613ac58..40e469379f 100644 --- a/src/shared/device-nodes.c +++ b/src/shared/device-nodes.c @@ -5,13 +5,13 @@ #include <string.h> #include "device-nodes.h" +#include "string-util.h" #include "utf8.h" int allow_listed_char_for_devnode(char c, const char *white) { return - (c >= '0' && c <= '9') || - (c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || + ascii_isdigit(c) || + ascii_isalpha(c) || strchr("#+-.:=@_", c) || (white && strchr(white, c)); } |