Make message log a TAILQ.

This commit is contained in:
nicm
2015-04-25 18:33:59 +00:00
parent 6dbd63ba4f
commit 07dfdb974d
6 changed files with 27 additions and 25 deletions

View File

@ -130,7 +130,6 @@ cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq)
struct client *c;
struct message_entry *msg;
char *tim;
u_int i;
int done;
done = 0;
@ -156,9 +155,7 @@ cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq)
if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL)
return (CMD_RETURN_ERROR);
for (i = 0; i < ARRAY_LENGTH(&c->message_log); i++) {
msg = &ARRAY_ITEM(&c->message_log, i);
TAILQ_FOREACH(msg, &c->message_log, entry) {
tim = ctime(&msg->msg_time);
*strchr(tim, '\n') = '\0';