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:
@ -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)
|
||||
|
Reference in New Issue
Block a user