SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 11/11/2010, 06:07 PM   #1
GaGlets(R)
Gangsta
 
GaGlets(R)'s Avatar
 
Join Date: Oct 2009
Posts: 932
Reputation: 2
Default sscanf2

I have this warning message how could i fix that

sscanf warning: String buffer overflow.

My server went down, probably this is the reason.
GaGlets(R) is offline  
Old 11/11/2010, 06:13 PM   #2
The_Moddler
High-roller
 
The_Moddler's Avatar
 
Join Date: Jan 2010
Location: In my house.
Posts: 1,168
Reputation: 3
Default Re: sscanf2

The warnings says it...

You have something like this(I think it's like this):

pawn Code:
new buff[64];
if(sscanf(bla("s[128]", buff)))

Change:

pawn Code:
if(sscanf(bla("s[128]", buff)))

To:

pawn Code:
if(sscanf(bla("s[64]", buff)))
__________________
The_Moddler is offline  
Old 11/11/2010, 06:14 PM   #3
GaGlets(R)
Gangsta
 
GaGlets(R)'s Avatar
 
Join Date: Oct 2009
Posts: 932
Reputation: 2
Default Re: sscanf2

bwah sorry. a little descripton what happened.

Server runned normaly for some while - about month or less .
Now most of the commands wont work and even onplayertext callback wont work. Any string formatting wont work.

edit:
why i cant use 128?

edit:
and also all gettick count wont work, if i have gettick count check it would say that its already working.
GaGlets(R) is offline  
Old 11/11/2010, 06:50 PM   #4
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 17,758
Reputation: 2463
Default Re: sscanf2

Actually, that error comes from trying to put a string of say 32 characters in to a buffer only 16 characters big.

I doubt that is the reason, unless you can prove it
Y_Less is offline  
Old 11/11/2010, 07:06 PM   #5
GaGlets(R)
Gangsta
 
GaGlets(R)'s Avatar
 
Join Date: Oct 2009
Posts: 932
Reputation: 2
Default Re: sscanf2

u mean if my buffer is 16 and im trying to put in there with sscanf 32 "s[32]" it would show the error ?

How i can prove it ?
GaGlets(R) is offline  
 

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
sscanf2 issue willsuckformoney Help Archive 11 09/11/2010 01:42 AM
sscanf2 Hornet600 Help Archive 10 01/11/2010 04:26 PM
sscanf2 ihatetn931 Help Archive 0 21/09/2010 05:54 AM
Givecash with SSCANF2 LZLo Help Archive 6 27/08/2010 05:06 PM
[HELP] sscanf2.0 dcmd_crash Help Archive 6 17/06/2010 06:36 PM


All times are GMT. The time now is 08:09 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.