Removed strcpy calls

This commit is contained in:
James Booth
2014-04-02 21:01:20 +01:00
parent e1db531875
commit a720ef2627
8 changed files with 31 additions and 34 deletions

View File

@@ -869,18 +869,15 @@ static void
_ui_print_system_msg_from_recipient(const char * const from, const char *message)
{
int num = 0;
char from_cpy[strlen(from) + 1];
char *bare_jid;
if (from == NULL || message == NULL)
return;
strcpy(from_cpy, from);
bare_jid = strtok(from_cpy, "/");
Jid *jid = jid_create(from);
ProfWin *window = wins_get_by_recipient(bare_jid);
ProfWin *window = wins_get_by_recipient(jid->barejid);
if (window == NULL) {
window = wins_new(bare_jid, WIN_CHAT);
window = wins_new(jid->barejid, WIN_CHAT);
if (window != NULL) {
num = wins_get_num(window);
status_bar_active(num);
@@ -892,12 +889,14 @@ _ui_print_system_msg_from_recipient(const char * const from, const char *message
}
win_print_time(window, '-');
wprintw(window->win, "*%s %s\n", bare_jid, message);
wprintw(window->win, "*%s %s\n", jid->barejid, message);
// this is the current window
if (wins_is_current(window)) {
wins_update_virtual_current();
}
jid_destroy(jid);
}
static void