While in principle the pointer could overflow, GCC 12 considers this to
not be possible and issues the following warning:
../src/lxc/cgroups/cgfsng.c: In function ‘__cgfsng_delegate_controllers’:
../src/lxc/cgroups/cgfsng.c:3306:21: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘it + 8’ must not be NULL [-Waddress]
3306 | if ((it + 1) && *(it + 1))
| ^
This removes the only build warning triggered when building on openSUSE.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
(void)strlcat(add_controllers, "+", full_len + 1);
(void)strlcat(add_controllers, *it, full_len + 1);
- if ((it + 1) && *(it + 1))
+ if (*(it + 1))
(void)strlcat(add_controllers, " ", full_len + 1);
}
* from the layout bitmask we created when parsing the cgroups.
*
* Keep the ordering in the switch otherwise the bistmask-based
- * matching won't work.
+ * matching won't work.
*/
if (ops->cgroup_layout == CGROUP_LAYOUT_UNKNOWN) {
switch (layout_mask) {