const char *t2="";
const char *t3="";
/* maximum of two levels :-) */
- if (c->parent!=NULL)
+ if (c->parent != NULL)
{
t1=c->parent->name;
t2="_";
Jim_Obj *cmd_list=Jim_NewListObj(interp, NULL, 0);
/* maximum of two levels :-) */
- if (c->parent!=NULL)
+ if (c->parent != NULL)
{
Jim_ListAppendElement(interp, cmd_list, Jim_NewStringObj(interp, c->parent->name, -1));
}
if (context == NULL)
return ERROR_OK;
- while(NULL != context->commands)
+ while (NULL != context->commands)
{
c = context->commands;
- while(NULL != c->children)
+ while (NULL != c->children)
{
c2 = c->children;
c->children = c->children->next;
/* find command */
c = context->commands;
- while(NULL != c)
+ while (NULL != c)
{
if (strcmp(name, c->name) == 0)
{
}
/* unregister children */
- while(NULL != c->children)
+ while (NULL != c->children)
{
c2 = c->children;
c->children = c->children->next;
void command_output_text(command_context_t *context, const char *data)
{
- if( context && context->output_handler && data ){
+ if ( context && context->output_handler && data ){
context->output_handler( context, data );
}
}
const char *t2="";
const char *t3="";
/* maximum of two levels :-) */
- if (c->parent!=NULL)
+ if (c->parent != NULL)
{
t1=c->parent->name;
t2=" ";
Jim_DeleteAssocData(interp, "context");
}
if (retcode == JIM_ERR) {
- if (retval!=ERROR_COMMAND_CLOSE_CONNECTION)
+ if (retval != ERROR_COMMAND_CLOSE_CONNECTION)
{
/* We do not print the connection closed error message */
Jim_PrintErrorMessage(interp);
va_list ap;
va_start(ap, format);
string = alloc_vprintf(format, ap);
- if (string!=NULL)
+ if (string != NULL)
{
retval=command_run_line(context, string);
}
int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- if (argc!=1)
+ if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
fast_and_dangerous = strcmp("enable", args[0])==0;
*ul = func(str, &end, 0); \
if (*end) \
return ERROR_COMMAND_ARGUMENT_INVALID; \
- if (*ul == max) \
+ if ((max == *ul) && (ERANGE == errno)) \
return ERROR_COMMAND_ARGUMENT_OVERFLOW; \
- if (min && min == *ul) \
+ if (min && (min == *ul) && (ERANGE == errno)) \
return ERROR_COMMAND_ARGUMENT_UNDERFLOW; \
return ERROR_OK; \
}