strcmp + empty string = FAIL - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: strcmp + empty string = FAIL (
/showthread.php?tid=287362)
strcmp + empty string = FAIL -
DRIFT_HUNTER - 02.10.2011
Ok im working on some kinda map system and sometimes i gave a empty strings so when i use strcmp
and i compare empty string with something strcmp return me 0 (strings are same) WTF?
I also tried to add length but still same bug...anyone can confirm these?
Im using 0.3c R5 Windows x86 (32bit)
Re: strcmp + empty string = FAIL -
DRIFT_HUNTER - 02.10.2011
Quote:
Originally Posted by ******
That has ALWAYS been the case - look at the ORIGINAL code for DCMD for one proof of this!
|
Well why does it do that? Maybe you can try explain me

I just dont get it....
[EDIT]And how to avoid these? I get idea to set all strings to None or something like that but than i will need to add more strcmp's and it will slow down my script to much since sometimes i loop even 20-30 times with strcmp in it...