core/unit: fix unit_add_target_dependencies() for units with no dependencies

For units without any dependencies, r needs to be initialized to 0.
Otherwise, the return value of unit_add_target_dependencies() is
unspecified.
This commit is contained in:
Daniel Mack 2014-02-20 13:29:54 +01:00
parent 6300b3eca9
commit db57f3c6d1

View file

@ -959,7 +959,7 @@ static int unit_add_target_dependencies(Unit *u) {
Unit *target;
Iterator i;
unsigned k;
int r;
int r = 0;
assert(u);