shared/install: rework an assert to appease gcc-13

With the previous form, gcc is confused and thinks that .type might be unset.

Fixes #26118.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-01-22 18:21:13 +01:00
parent 4a4af850b3
commit 8f5d716a71

View File

@ -342,7 +342,8 @@ void install_changes_dump(int r, const char *verb, const InstallChange *changes,
assert(verb || r >= 0);
for (size_t i = 0; i < n_changes; i++) {
assert(verb || changes[i].type >= 0);
if (changes[i].type < 0)
assert(verb);
assert(changes[i].path);
/* When making changes here, make sure to also change install_error() in dbus-manager.c. */