913c1916 changed _ACTION_INVALID to negative, changing the enum to a
signed type. Take care to avoid comparing it with an unsigned type.
../src/systemctl/systemctl.c: In function ‘start_unit’:
../src/systemctl/systemctl.c:3107:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
assert(arg_action < ELEMENTSOF(action_table));
one_name = NULL;
}
} else {
- assert(arg_action < ELEMENTSOF(action_table));
+ assert(arg_action >= 0 && arg_action < _ACTION_MAX);
assert(action_table[arg_action].target);
assert(action_table[arg_action].mode);
[ACTION_RESCUE] = '1'
};
- assert(arg_action < _ACTION_MAX);
+ assert(arg_action >= 0 && arg_action < _ACTION_MAX);
return table[arg_action];
}