summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-03-21 14:24:50 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-23 21:57:25 +0900
commit3e3ee42072c4ef5cd1464cbec5d78e5c933fcb14 (patch)
treedc0d536b989e94541654517e13689449a3226f5a /src/udev/udev-rules.c
parent50996f04ad1b2db36bb210c1bd1c3526f861ea45 (diff)
downloadsystemd-3e3ee42072c4ef5cd1464cbec5d78e5c933fcb14.tar.gz
tree-wide: use PTR_SUB1() at two places where appropriate
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index d245c2c7b3..b46cb0f906 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1830,7 +1830,7 @@ static int udev_rule_apply_token_to_event(
bool found = false;
/* Drop the last line. */
- for (char *p = buf + strlen(buf) - 1; p >= buf; p--)
+ for (char *p = PTR_SUB1(buf + strlen(buf), buf); p; p = PTR_SUB1(p, buf))
if (strchr(NEWLINE, *p)) {
*p = '\0';
found = true;