Quick question about '\1'
#1

Hello guys, what does mean this when I use it? \1
Reply
#2

Nothing
Reply
#3

You shouldn't use that at all, but there is use of \0.
That means that string is null ( empty )
Passing such string trough callremotefunction WILL crash server.
Reply
#4

Yeah, that's true I'm using it for empty string in CallLocalFunction, but \0 not work, I've tried this:
pawn Код:
CallLocalFunction(cmdname, "is", playerid, "\0");
//and this too
CallLocalFunction(cmdname, "is", playerid, '\0');
Both crashes server
Reply
#5

Quote:
Originally Posted by Riwerry
Посмотреть сообщение
Yeah, that's true I'm using it for empty string in CallLocalFunction, but \0 not work, I've tried this:
pawn Код:
CallLocalFunction(cmdname, "is", playerid, "\0");
//and this too
CallLocalFunction(cmdname, "is", playerid, '\0');
Both crashes server
"\0" is END OF STRING
if 1st character is end of string, obviously it will have troubles.

Just do not use it. You do not need to pass empty string.
Unless you want to crash the server... Which I once did
Reply
#6

Okay, now I have second little off topic question.
Is possible to parse preprocessor define string for example to include?
In GM:
pawn Код:
#include mystring "foo"
In INC for example:
pawn Код:
print(mystring);
I've tried it but I'm getting error in include, that it's undefined.
Reply
#7

ZCMD uses "\1" as argument of "cmdtext" when it's supposed to be NULL. Although, due to the bug that crashes the server if the string is empty, using "\1" is like using nothing and it prevents the crash.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
ZCMD uses "\1" as argument of "cmdtext" when it's supposed to be NULL. Although, due to the bug that crashes the server if the string is empty, using "\1" is like using nothing and it prevents the crash.
Yes, you're right. "\1" is one byte which will prevent crashing issue.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)