mirror of https://github.com/OpenTTD/OpenTTD
(svn r22955) -Fix: guard from reading outside the silly name list
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