diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/console.c | 4 | ||||
-rw-r--r-- | src/common/socket.c | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/common/console.c b/src/common/console.c index 0b1b9cf93..d9567a313 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -311,12 +311,12 @@ void console_parse_list_subs(struct CParseEntry *cmd, unsigned char depth) { for( i = 0; i < cmd->next_count; i++ ) { if( cmd->u.next[i]->next_count ) { memset(msg, '-', depth); - snprintf(msg + depth,CP_CMD_LENGTH * 2, " '"CL_WHITE"%s"CL_RESET"'",cmd->u.next[i]->cmd); + snprintf(msg + depth,( CP_CMD_LENGTH * 2 ) - depth, " '"CL_WHITE"%s"CL_RESET"'",cmd->u.next[i]->cmd); ShowInfo("%s subs\n",msg); console->input->parse_list_subs(cmd->u.next[i],depth + 1); } else { memset(msg, '-', depth); - snprintf(msg + depth,CP_CMD_LENGTH * 2, " %s",cmd->u.next[i]->cmd); + snprintf(msg + depth,(CP_CMD_LENGTH * 2) - depth, " %s",cmd->u.next[i]->cmd); ShowInfo("%s\n",msg); } } diff --git a/src/common/socket.c b/src/common/socket.c index c0864c9b3..2ab37109c 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -1319,6 +1319,7 @@ int socket_getips(uint32* ips, int max) if( sIoctl(fd, SIOCGIFCONF, &ic) == -1 ) { ShowError("socket_getips: SIOCGIFCONF failed!\n"); + sClose(fd); return 0; } else |