You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the function returns, the array that it points to is then in unused stack space which will be overwritten the moment another function is called.
I haven't got a WiFi shield to test it with, however I cannot see how this code can work. The result of the function is immediately passed into another function, so the stack frame where the variable used to reside will be overwritten before it's ever used.
The gains variable should be declared static on line 2179 to prevent it from going out of scope when the function returns.
The text was updated successfully, but these errors were encountered:
In the function
uint8_t *OpenBCI_32bit_Library::getGains(void)
it creates an array on the stack and then returns a pointer to that array.After the function returns, the array that it points to is then in unused stack space which will be overwritten the moment another function is called.
I haven't got a WiFi shield to test it with, however I cannot see how this code can work. The result of the function is immediately passed into another function, so the stack frame where the variable used to reside will be overwritten before it's ever used.
The
gains
variable should be declared static on line 2179 to prevent it from going out of scope when the function returns.The text was updated successfully, but these errors were encountered: