mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[11725] Fixed chat command parse with explicit literal check.
Before fix ExtractLiteralArg(str,"abc") reject "ab" string wrongly.
This commit is contained in:
parent
4ec136222a
commit
1221a60d57
2 changed files with 9 additions and 1 deletions
|
|
@ -2316,6 +2316,14 @@ char* ChatHandler::ExtractLiteralArg(char** args, char const* lit /*= NULL*/)
|
|||
if (lit)
|
||||
{
|
||||
int l = strlen(lit);
|
||||
|
||||
int largs = 0;
|
||||
while(head[largs] && !isWhiteSpace(head[largs]))
|
||||
++largs;
|
||||
|
||||
if (largs < l)
|
||||
l = largs;
|
||||
|
||||
int diff = strncmp(head, lit, l);
|
||||
|
||||
if (diff != 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue