Minor cleanups

Signed-off-by: Jan Vidar Krey <janvidar@extatic.org>
This commit is contained in:
Jan Vidar Krey 2009-03-20 19:02:32 +01:00
parent 7985d4fed0
commit f9e95ec582

View File

@ -42,9 +42,11 @@ static void send_message(struct user* user, const char* message)
hub_free(buffer); 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; 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) static int command_myip(struct user* user, const char* message)
{ {
char tmp[128]; char tmp[128];
snprintf(tmp, 128, "*** Your IP: %s", ip_convert_to_string(&user->ipaddr));
tmp[0] = 0;
strcat(tmp, "*** Your IP: ");
strcat(tmp, ip_convert_to_string(&user->ipaddr));
send_message(user, tmp); send_message(user, tmp);
return 0; return 0;
} }
@ -174,7 +172,7 @@ int command_dipatcher(struct user* user, const char* message)
} }
else else
{ {
return command_access_denied(user); return command_access_denied(user, &command_handlers[n].prefix[1]);
} }
} }
} }