Y-Less / sscanf

SA:MP sscanf plugin originally made by @Y-Less
Other
122 stars 51 forks source link

Bug #20

Closed ghost closed 6 years ago

ghost commented 6 years ago
new 
text[85], action[85]; 
if (sscanf(params, "p<*>s[85]s[85]", text, action)) { 
    SendClientMessage(playerid, -1, "- /todo [text*action]"); 
    return 1; 
}  

/ todo *test, that is, the first (text) can be skipped

I fixed it if (sscanf(params, "p<*>s[85]s[85]", text, action) || params[strfind(params, "*", true) - 1] == '\0')

maddinat0r commented 6 years ago

Judging by the plugin code, this does not look like a bug. The plugin simply parses an empty string into text. You should just check if text is empty, i.e. text[0] == '\0'.

ghost commented 6 years ago

But, at me, for some reason it didn't turn out with text[0] Works if I make text[-1]

Using Pawn.CMD

maddinat0r commented 6 years ago

text[-1] isn't valid PAWN code and won't compile. So yeah, this isn't a plugin bug.