Raised This Month: $ Target: $400
 0% 

Index out of bounds problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
chungsy
Member
Join Date: Nov 2011
Old 03-20-2013 , 21:42   Re: Index out of bounds problem
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
That code is essentially the same as the first one you posted.



Where in my code do you see "g_szCfgs[g_iCounter]"? No where. You need to do exactly what I did with your array in place of g_szCfgs if you want to do it my way.

However, I'm starting to think you should stick with the method in post #5. It is correct and will work. If it doesn't work then [I already suggested reasons] and if those didn't solve the problem then you need to debug it. Print the values of g_iCounter after every line that uses g_iCounter.
I think I got the index out of bound fixed by using post #5 method.

But I'm still getting errors

L 03/20/2013 - 209:12: [AMXX] Run time error 5: memory access
L 03/20/2013 - 209:12: [AMXX] [0] server_query.inc::ServerResponseReadByte (line 230)
L 03/20/2013 - 209:12: [AMXX] [1] server_query.inc::ServerResponseParseInfo (line 119)
L 03/20/2013 - 209:12: [AMXX] [2] serversinfo.sma::cbInfo (line 48 )

For server_query.inc::ServerResponseParseInfo (line 119)

Code:
 new iType;
 new iTemp;
 new current = 0;
 current += ServerResponseReadByte(Response[current], iType);
For server_query.inc::ServerResponseReadByte (line 230)

Code:
stock ServerResponseReadByte(const Response[], &res)
{
 res = Response[0] & 0xFF;
 return 1;
}
And serversinfo.sma::cbInfo (line 48

Code:
ServerResponseParseInfo(Response, szName, 63, szMap, 63, szDirectory, 63, szDescription, 63, iPlayers, iMaxPlayers);

Last edited by chungsy; 03-20-2013 at 21:46.
chungsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode