19.11.2009, 15:39
Hey.
I just have got the problem of following error:
Here the Lines making problems:
I thought it would be a problem with strtok, but i'm unsure . Does anyone have a sollution for that?
Here my strtok code:
Thanks.
I just have got the problem of following error:
Код:
....(126) : error 047: array sizes do not match, or destination array is too small ....(131) : error 047: array sizes do not match, or destination array is too small
pawn Код:
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/dkick", cmd, true, 10) == 0)
{
new tmp[10];
tmp = strtok(cmdtext, idx);
//etc......
}
Here my strtok code:
pawn Код:
stock strtok(const string[], &index,seperator=' ')
{
new length = strlen(string);
new offset = index;
new result[MAX_STRING];
while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
if ((index < length) && (string[index] == seperator))
{
index++;
}
return result;
}