summaryrefslogtreecommitdiffstats
path: root/src/basic/terminal-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-07-05 11:55:26 +0200
committerLennart Poettering <lennart@poettering.net>2022-07-05 14:25:07 +0200
commitff25d3385dfbf493c878c9e227df56db3dc10b6a (patch)
treea4302f4eb82e157abfa94c3045a65abeafdbb3af /src/basic/terminal-util.c
parentsd-id128: don't allow chars > f in valid id128 values (diff)
downloadsystemd-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/basic/terminal-util.c')
-rw-r--r--src/basic/terminal-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index a142ba2dfb..0c092597eb 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -624,7 +624,7 @@ int vtnr_from_tty(const char *tty) {
if (!startswith(tty, "tty") )
return -EINVAL;
- if (tty[3] < '0' || tty[3] > '9')
+ if (!ascii_isdigit(tty[3]))
return -EINVAL;
r = safe_atoi(tty+3, &i);