coverity scan CID 22574: copy into fixed size buffer

zOrder *should* probably be big enough, but static analysis says safe is safe.
This commit is contained in:
Enno Rehling 2015-10-29 09:28:02 +01:00
parent 6ebfd33478
commit 55b3bfd90e
1 changed files with 2 additions and 2 deletions

View File

@ -430,8 +430,8 @@ int teach_cmd(unit * u, struct order *ord)
/* Neuen Befehl zusammenbauen. TEMP-Einheiten werden automatisch in
* ihre neuen Nummern uebersetzt. */
if (zOrder[0])
strcat(zOrder, " ");
strcat(zOrder, unitid(u2));
strncat(zOrder, " ", sizeof(zOrder));
strncat(zOrder, unitid(u2), sizeof(zOrder));
if (getkeyword(u2->thisorder) != K_STUDY) {
ADDMSG(&u->faction->msgs,