1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-13 01:43:02 +01:00
This commit is contained in:
Jfreegman 2014-03-29 05:44:20 -04:00
parent d873181306
commit 1b89af9063
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
3 changed files with 6 additions and 6 deletions

View File

@ -335,8 +335,8 @@ void cmd_nick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA
}
if (len > TOXIC_MAX_NAME_LENGTH) {
nick[TOXIC_MAX_NAME_LENGTH] = L'\0';
len = TOXIC_MAX_NAME_LENGTH;
nick[len-1] = L'\0';
}
tox_set_name(m, nick, len+1);

View File

@ -304,7 +304,7 @@ static void groupchat_onGroupNamelistChange(ToxWindow *self, Tox *m, int groupnu
event = " is now known as ";
line_info_add(self, timefrmt, oldpeername, peername, event, NAME_CHANGE, 0, 0);
uint8_t tmp_event[TOXIC_MAX_NAME_LENGTH + 32];
uint8_t tmp_event[TOXIC_MAX_NAME_LENGTH * 2 + 32];
snprintf(tmp_event, sizeof(tmp_event), "is now known as %s", peername);
write_to_log(tmp_event, oldpeername, ctx->log, true);
break;

View File

@ -118,16 +118,16 @@ void line_info_add(ToxWindow *self, uint8_t *tmstmp, uint8_t *name1, uint8_t *na
}
if (msg) {
memcpy(new_line->msg, msg, MAX_STR_SIZE);
memcpy(new_line->msg, msg, sizeof(new_line->msg));
len += strlen(msg);
} if (tmstmp) {
memcpy(new_line->timestamp, tmstmp, TIME_STR_SIZE);
memcpy(new_line->timestamp, tmstmp, sizeof(new_line->timestamp));
len += strlen(tmstmp);
} if (name1) {
memcpy(new_line->name1, name1, TOXIC_MAX_NAME_LENGTH);
memcpy(new_line->name1, name1, sizeof(new_line->name1));
len += strlen(name1);
} if (name2) {
memcpy(new_line->name2, name2, TOXIC_MAX_NAME_LENGTH);
memcpy(new_line->name2, name2, sizeof(new_line->name2));
len += strlen(name2);
}