1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-06-29 13:37:47 +02:00

change a few memcpy's to strcpy to fix possible segfaults

This commit is contained in:
Jfreegman 2014-04-26 04:09:51 -04:00
parent 81125be971
commit 6b72ef0720
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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);
}