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/udev | |
parent | 82c3a0b74c8decccf2e1e384e7ad02def4a07459 (diff) | |
download | systemd-ff25d3385dfbf493c878c9e227df56db3dc10b6a.tar.gz |
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/udev')
-rw-r--r-- | src/udev/udev-builtin-path_id.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index ae92e45205..d33eede984 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -695,9 +695,8 @@ static int builtin_path_id(sd_device *dev, sd_netlink **rtnl, int argc, char *ar /* compose valid udev tag name */ for (const char *p = path; *p; p++) { - if ((*p >= '0' && *p <= '9') || - (*p >= 'A' && *p <= 'Z') || - (*p >= 'a' && *p <= 'z') || + if (ascii_isdigit(*p) || + ascii_isalpha(*p) || *p == '-') { tag[i++] = *p; continue; |