sscanf2, compare
#1

First, i wanna tell you I haven't scripted for a couple of years so this is probably a simple
mistake i can't figure out xD

But I have this piece of code
pawn Код:
if(!sscanf(pass,"s[129]",passini))
    {
As you might understand, it is a Whirlpool string I'm trying to compare.
To be exact, the string 'pass' is the encrypted string of a dialog input,
and the string 'passini' is an encrypted string stored in a file.

Even though the server is perfectly aware these two strings are not like each other,
it passes through, any code inside that statement runs, no matter what password i enter.

Код:
[18:29:16] pass: 212C5405DCFE95D52EC67780A9504C92E877F69AE1A2E5F01179F2C74B729708AC5B2B52F2A3F1B600D80D9D1DACF47A85723060AF5F58C320E2E78DFD95F11E
[18:29:16] passini: 2D619A328B231CD10024E714EB2AC3CB43264003DEBF14B4B12B30A7D7D0911395068255203D19E26E4D1803EAD4D1BC9D8F8135ECE5BC3223BBF2249282F6D9
As far as i know, sscanf means "Not" and therefore !sscanf, right?
Reply
#2

Код:
if(!strcmp(pass, passini)) // Compare two strings
{
   // Code here
}
Reply
#3

Oh, right... so what I'm checking for is simply if the length of the second string matches the first one? :S
Reply
#4

Quote:
Originally Posted by liquor
Посмотреть сообщение
Oh, right... so what I'm checking for is simply if the length of the second string matches the first one? :S
Read:

https://sampwiki.blast.hk/wiki/Strcmp
https://sampwiki.blast.hk/wiki/Strlen
Reply
#5

No, i do understand strcmp but what I meant was what my original code was doing :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)