View Single Post
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 11-07-2014 , 16:31   Re: [ANY] Admin RegAdminCmd Logging
Reply With Quote #4

Quote:
Originally Posted by Powerlord View Post
A few issues I can see just from glancing at it:
  1. This leaks a handle because you never close the CommandIterator handle. GetCommandIterator's docs even warns you about this.
  2. It captures all commands, not just admin commands. To avoid this, you need to check the Flags argument to see if any flags are set on the command.
  3. As far as I can tell, this loops from 0 to MaxRegAdminComands no matter how many commands actually exist. Consider using a while loop to avoid this (such as while(ReadCommandIterator(CmdIter, Name, sizeof(Name), Flags, Desc, sizeof(Desc))
  4. 32 is being hard-coded instead of using the MAX_NAME_LENGTH constant.
Okay.. I'll fix this and update it really soon.
__________________

Last edited by El Diablo War3Evo; 11-07-2014 at 16:31.
El Diablo War3Evo is offline