Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(error) array index out of bounds #178

Open
flamesidgs opened this issue Aug 13, 2023 · 1 comment
Open

(error) array index out of bounds #178

flamesidgs opened this issue Aug 13, 2023 · 1 comment

Comments

@flamesidgs
Copy link

dependencies\sa-mp-fixes\fixes.inc:17374 (error) array index out of bounds (variable "FIXES_gsPlayerPGTShown")
dependencies\sa-mp-fixes\fixes.inc:17571 (error) array index out of bounds (variable "FIXES_gsPlayerPGTShown")
dependencies\sa-mp-fixes\fixes.inc:17788 (error) array index out of bounds (variable "FIXES_gsPlayersIterator")
I get an error on a variable that is in fixes include

@Y-Less
Copy link
Member

Y-Less commented Aug 25, 2023

Those errors don't make any sense. Line 17374 is:

FIXES_gsPlayerPGTShown[i][MAX_PLAYERS] = MAX_PLAYERS;

The compiler can't detect an OOB from i (defined by a loop using sizeof anyway), so it must be from MAX_PLAYERS, but the array is declared with:

FIXES_gsPlayerPGTShown[FIXES_GT_STYLE_COUNT][MAX_PLAYERS + 1];

Which is by definition large enough to index MAX_PLAYERS, because of the + 1. How is your MAX_PLAYERS declared? Have you edited anything? Any other includes before fixes.inc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants