CID 22554: Improper use of negative value (REVERSE_NEGATIVE)

I believe this was a false positive, but more asserts can never hurt.
This commit is contained in:
Enno Rehling 2015-10-30 12:40:48 +01:00
parent 93b7bacff5
commit e1eb5098d4
2 changed files with 2 additions and 0 deletions

View File

@ -735,6 +735,7 @@ variant read_unit_reference(struct storage * store)
int get_level(const unit * u, skill_t id)
{
assert(id != NOSKILL);
if (skill_enabled(id)) {
skill *sv = u->skills;
while (sv != u->skills + u->skill_size) {

View File

@ -45,6 +45,7 @@ const char *skillnames[MAXSKILLS] = {
bool skill_disabled[MAXSKILLS];
bool skill_enabled(skill_t sk) {
assert(sk != NOSKILL);
return !skill_disabled[sk];
}