forked from github/server
CID 22464 Division or modulo by zero
This commit is contained in:
parent
876e4122b1
commit
1093a23d5a
1 changed files with 3 additions and 0 deletions
|
@ -160,6 +160,9 @@ const unit *random_unit_in_faction(const faction * f)
|
||||||
unit *u;
|
unit *u;
|
||||||
int c = 0, u_nr;
|
int c = 0, u_nr;
|
||||||
|
|
||||||
|
if (!f->units) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
for (u = f->units; u; u = u->next)
|
for (u = f->units; u; u = u->next)
|
||||||
c++;
|
c++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue