sscanf and zcmd question about commands with multi parameters
#4

pawn Code:
new string[64],
    option[4],
    item[5],
    amount[5];
       
  sscanf(params, "sss", option, item, amount);
One of the problems with sscanf is there's no overflow protection. If you type "/safe aaaaaaaaaaaaaaaaa" for example, option (which is only 4 cells) will overflow. You need to make any strings big enough so they wont overflow
pawn Code:
new string[64],
    option[128],
    item[128],
    amount[128];
       
  sscanf(params, "sss", option, item, amount);
Reply


Messages In This Thread
sscanf and zcmd question about commands with multi parameters - by Dujma - 20.11.2009, 18:02
Re: sscanf and zcmd question about commands with multi parameters - by Dujma - 20.11.2009, 18:18
Re: sscanf and zcmd question about commands with multi parameters - by Dujma - 20.11.2009, 18:54
Re: sscanf and zcmd question about commands with multi parameters - by Dabombber - 21.11.2009, 01:24

Forum Jump:


Users browsing this thread: 3 Guest(s)