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

View file

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