mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 22:26:21 +00:00
Removed strcpy calls
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user