mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r22955) -Fix: guard from reading outside the silly name list
This commit is contained in:
parent
f65a1bd847
commit
1f266ec977
@ -1409,7 +1409,7 @@ static char *GetSpecialNameString(char *buff, int ind, StringParameters *args, c
|
|||||||
{
|
{
|
||||||
switch (ind) {
|
switch (ind) {
|
||||||
case 1: // not used
|
case 1: // not used
|
||||||
return strecpy(buff, _silly_company_names[args->GetInt32() & 0xFFFF], last);
|
return strecpy(buff, _silly_company_names[min(args->GetInt32() & 0xFFFF, lengthof(_silly_company_names) - 1)], last);
|
||||||
|
|
||||||
case 2: // used for Foobar & Co company names
|
case 2: // used for Foobar & Co company names
|
||||||
return GenAndCoName(buff, args->GetInt32(), last);
|
return GenAndCoName(buff, args->GetInt32(), last);
|
||||||
|
Loading…
Reference in New Issue
Block a user