what the problem with this in sscanf?
#1

it always appear string buffer oveflow in the new name and loc
pawn Код:
if(!strcmp(option, "name", true, 4))
    {
        new name[32];
        if(sscanf(params, "is[10]s[32]",i,option,name)) return SCM(playerid,-1, "[Usage]: /credit [robid] name [name]");
        if(PickInfo[i][pPick] == 0) return SendClientMessage(playerid,-1, "Invalid door id.");
        format(string, sizeof(string), " You have set rob ID %d's name to %s",i,name);
        SCM(playerid,COLOR_LIGHTBLUE, string);
        PickInfo[i][pRname] = name;
    }
    if(!strcmp(option, "location", true, 8))
    {
        new loc[32];
        if(sscanf(params, "is[10]s[32]",i,option,loc)) return SCM(playerid,-1, "[Usage]: /credit [robid] location [loc]");
        if(PickInfo[i][pPick] == 0) return SendClientMessage(playerid,-1, "Invalid door id.");
        format(string, sizeof(string), " You have set rob ID %d's location to %s",i,loc);
        SCM(playerid,COLOR_LIGHTBLUE, string);
        PickInfo[i][pLoc] = loc;
    }
Reply


Messages In This Thread
what the problem with this in sscanf? - by drichie - 07.07.2013, 05:51
Re: what the problem with this in sscanf? - by SwisherSweet - 07.07.2013, 06:33
Re: what the problem with this in sscanf? - by drichie - 07.07.2013, 07:12
Re: what the problem with this in sscanf? - by Konstantinos - 07.07.2013, 09:19
Re: what the problem with this in sscanf? - by drichie - 08.07.2013, 13:35
Re: what the problem with this in sscanf? - by drichie - 08.07.2013, 13:53
Re: what the problem with this in sscanf? - by drichie - 08.07.2013, 14:39
Re: what the problem with this in sscanf? - by Konstantinos - 08.07.2013, 15:28

Forum Jump:


Users browsing this thread: 3 Guest(s)