Minor cleanups
Signed-off-by: Jan Vidar Krey <janvidar@extatic.org>
This commit is contained in:
parent
7985d4fed0
commit
f9e95ec582
|
@ -42,9 +42,11 @@ static void send_message(struct user* user, const char* message)
|
|||
hub_free(buffer);
|
||||
}
|
||||
|
||||
static int command_access_denied(struct user* user)
|
||||
static int command_access_denied(struct user* user, const char* command)
|
||||
{
|
||||
send_message(user, "*** Access denied.");
|
||||
char temp[64];
|
||||
snprintf(temp, 64, "*** Access denied: \"%s\"", command);
|
||||
send_message(user, temp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -152,11 +154,7 @@ static int command_version(struct user* user, const char* message)
|
|||
static int command_myip(struct user* user, const char* message)
|
||||
{
|
||||
char tmp[128];
|
||||
|
||||
tmp[0] = 0;
|
||||
strcat(tmp, "*** Your IP: ");
|
||||
strcat(tmp, ip_convert_to_string(&user->ipaddr));
|
||||
|
||||
snprintf(tmp, 128, "*** Your IP: %s", ip_convert_to_string(&user->ipaddr));
|
||||
send_message(user, tmp);
|
||||
return 0;
|
||||
}
|
||||
|
@ -174,7 +172,7 @@ int command_dipatcher(struct user* user, const char* message)
|
|||
}
|
||||
else
|
||||
{
|
||||
return command_access_denied(user);
|
||||
return command_access_denied(user, &command_handlers[n].prefix[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue