CallLocalFunction() crashes with empty string
#1

Hi, I saw now empty strings don't crash the server anymore with printf and many others function, but they still crash with some, like CallLocalFunction().

Code:
CallLocalFunction(strFunction, "is", playerid, params);
Will crash the server if params is an empty string.
Reply
#2

It depends on the function given in strFunction.
For example it is "Foo" and Foo does anything with a string.
Maybe there's a function in Foo that crashes with empty strings ...
Reply
#3

That's correct. CallLocalFunction and CallRemoteFunction crash when you pass an empty string.
I suggest passing "\1" and using isnull in the called function to check if it was meant to be empty.
Reply
#4

Meta:
public cmd_kill(playerid, params[])
It doesn't deal with the string, the problem come from CallLocalFunction.

ev0lutionnn:
Yeah I already use similar ('%'), thanks.
Reply
#5

What crash message are you getting? Are you getting a server segfault? Linux or windows?
Reply
#6

In crashinfo.txt? I don't know what is a server segfault. It's on Windows.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)