1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 13:26:44 +02:00

code cleanup, improve welcome message

This commit is contained in:
Jfreegman
2014-07-04 13:24:18 -04:00
parent 91c4414889
commit de1e61bd5a
6 changed files with 24 additions and 28 deletions

View File

@ -875,15 +875,12 @@ static void chat_onInit(ToxWindow *self, Tox *m)
ctx->history = subwin(self->window, y2 - CHATBOX_HEIGHT + 1, x2, 0, 0);
ctx->linewin = subwin(self->window, CHATBOX_HEIGHT, x2, y2 - CHATBOX_HEIGHT, 0);
ctx->hst = malloc(sizeof(struct history));
ctx->log = malloc(sizeof(struct chatlog));
ctx->hst = calloc(1, sizeof(struct history));
ctx->log = calloc(1, sizeof(struct chatlog));
if (ctx->log == NULL || ctx->hst == NULL)
exit_toxic_err("failed in chat_onInit", FATALERR_MEMORY);
memset(ctx->hst, 0, sizeof(struct history));
memset(ctx->log, 0, sizeof(struct chatlog));
line_info_init(ctx->hst);
if (friends[self->num].logging_on)