forked from github/server
CID 22550: Dereference before null check (REVERSE_INULL)
This commit is contained in:
parent
1d204b12f1
commit
1df0afc58a
|
@ -289,7 +289,7 @@ message * give_men(int n, unit * u, unit * u2, struct order *ord)
|
||||||
else {
|
else {
|
||||||
if (n > u->number)
|
if (n > u->number)
|
||||||
n = u->number;
|
n = u->number;
|
||||||
if (u2 && n + u2->number > UNIT_MAXSIZE) {
|
if (n + u2->number > UNIT_MAXSIZE) {
|
||||||
n = UNIT_MAXSIZE - u2->number;
|
n = UNIT_MAXSIZE - u2->number;
|
||||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_unit_size",
|
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_unit_size",
|
||||||
"maxsize", UNIT_MAXSIZE));
|
"maxsize", UNIT_MAXSIZE));
|
||||||
|
|
Loading…
Reference in New Issue