Bug function strrest.
#1

I use strrest:

pawn Код:
stock strrest(const stringstrrest[], &index)
{
    new length = strlen(stringstrrest);
    while ((index < length) && (stringstrrest[index] <= ' '))
    {
        index++;
    }
    new offset = index;
    new result[128];
    while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = stringstrrest[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
In my line:

result = strrest(cmdtext, idx);

I have this error:

error 047: array sizes do not match, or destination array is too small
Reply
#2

Use sscanf instead of relying on outdated methods.
Reply
#3

No ...
Reply
#4

Can you help me plz??
Reply
#5

try
pawn Код:
new result[256];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)