1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-06-18 15:07:47 +02:00

don't modify name list when truncating nicks to fit in groupchat side panel

This commit is contained in:
Jfreegman 2014-01-30 22:01:08 -05:00
parent a028de17cd
commit ebf7d4517f

View File

@ -532,8 +532,13 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m)
for (i = 0; i < num_peers && i < maxlines; ++i) {
wmove(ctx->sidebar, i+2, 1);
int peer = i + groupchats[self->num].side_pos;
groupchats[self->num].peer_names[peer*N+SIDEBAR_WIDTH-2] = '\0';
wprintw(ctx->sidebar, "%s\n", &groupchats[self->num].peer_names[peer*N]);
/* truncate nick to fit in side panel without modifying list */
uint8_t tmpnck[TOX_MAX_NAME_LENGTH];
memcpy(tmpnck, &groupchats[self->num].peer_names[peer*N], SIDEBAR_WIDTH-3);
tmpnck[SIDEBAR_WIDTH-2] = '\0';
wprintw(ctx->sidebar, "%s\n", tmpnck);
}
}