mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 03:23:02 +01:00
change a few memcpy's to strcpy to fix possible segfaults
This commit is contained in:
parent
81125be971
commit
6b72ef0720
@ -542,7 +542,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m)
|
||||
wmove(self->window, y2 - 1, 1);
|
||||
|
||||
wattron(self->window, A_BOLD);
|
||||
wprintw(self->window, " ID: ");
|
||||
wprintw(self->window, "ID: ");
|
||||
wattroff(self->window, A_BOLD);
|
||||
|
||||
int i;
|
||||
|
@ -135,22 +135,22 @@ void line_info_add(ToxWindow *self, uint8_t *tmstmp, uint8_t *name1, uint8_t *na
|
||||
}
|
||||
|
||||
if (msg) {
|
||||
memcpy(new_line->msg, msg, sizeof(new_line->msg));
|
||||
strcpy(new_line->msg, msg);
|
||||
len += strlen(msg);
|
||||
}
|
||||
|
||||
if (tmstmp) {
|
||||
memcpy(new_line->timestamp, tmstmp, sizeof(new_line->timestamp));
|
||||
strcpy(new_line->timestamp, tmstmp);
|
||||
len += strlen(tmstmp);
|
||||
}
|
||||
|
||||
if (name1) {
|
||||
memcpy(new_line->name1, name1, sizeof(new_line->name1));
|
||||
strcpy(new_line->name1, name1);
|
||||
len += strlen(name1);
|
||||
}
|
||||
|
||||
if (name2) {
|
||||
memcpy(new_line->name2, name2, sizeof(new_line->name2));
|
||||
strcpy(new_line->name2, name2);
|
||||
len += strlen(name2);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user