command_handler_t: make argc unsigned

The number of command arguments will always be 0 or more, so use
the right type in handlers.  This has a cascading effect up through
the layers, but the new COMMAND_HANDLER macros prevented total chaos.
This commit is contained in:
Zachary T Welch
2009-11-10 00:02:18 -08:00
parent a585bdf726
commit d22270e0ed
7 changed files with 12 additions and 18 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ typedef struct command_context_s
*/
#define __COMMAND_HANDLER(name, extra...) \
int name(struct command_context_s *cmd_ctx, \
char *cmd, char **args, int argc, ##extra)
char *cmd, char **args, unsigned argc, ##extra)
/**
* Use this to macro to call a command helper (or a nested handler).
+1 -1
View File
@@ -214,9 +214,9 @@ COMMAND_HANDLER(handle_append_command)
config_file = fopen(args[0], "a");
if (config_file != NULL)
{
int i;
fseek(config_file, 0, SEEK_END);
unsigned i;
for (i = 1; i < argc; i++)
{
if (fwrite(args[i], 1, strlen(args[i]), config_file) != strlen(args[i]))