1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-26 17:25:34 +03:00

string-util: fix build error on aarch64

This fixes the following error:
```
In file included from ../src/basic/af-list.h:6,
                 from ../src/basic/af-list.c:7:
../src/basic/string-util.h: In function 'char_is_cc':
../src/basic/string-util.h:133:19: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  133 |         return (p >= 0 && p < ' ') || p == 127;
      |                   ^~
cc1: all warnings being treated as errors
```

Fixes #19543.
This commit is contained in:
Yu Watanabe 2021-05-08 04:13:12 +09:00 committed by Lennart Poettering
parent f2ef6d98e6
commit 7971f9030a

View File

@ -130,7 +130,7 @@ static inline bool _pure_ in_charset(const char *s, const char* charset) {
}
static inline bool char_is_cc(char p) {
return (p >= 0 && p < ' ') || p == 127;
return (uint8_t) p < ' ' || p == 127;
}
bool string_has_cc(const char *p, const char *ok) _pure_;