tree-wide: use PTR_SUB1() at two places where appropriate
This commit is contained in:
committed by
Yu Watanabe
parent
50996f04ad
commit
3e3ee42072
+1
-1
@@ -134,7 +134,7 @@ bool strv_overlap(char * const *a, char * const *b) _pure_;
|
||||
_len > 0 ? h + _len - 1 : NULL; \
|
||||
}); \
|
||||
(s = i); \
|
||||
i > h ? i-- : (i = NULL))
|
||||
i = PTR_SUB1(i, h))
|
||||
|
||||
#define STRV_FOREACH_BACKWARDS(s, l) \
|
||||
_STRV_FOREACH_BACKWARDS(s, l, UNIQ_T(h, UNIQ), UNIQ_T(i, UNIQ))
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user