1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

if printformat() was given a argument ending with ^C it could mess up

one or two chars of the following text (part/quit messages).


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@676 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-09-26 22:02:19 +00:00 committed by cras
parent 91b4c3af46
commit 3d627ca527

View File

@ -385,8 +385,18 @@ static char *output_format_text_args(TEXT_DEST_REC *dest, FORMAT_REC *format,
ret = parse_special((char **) &str, active_win->active_server,
active_win->active, arglist, &need_free, NULL);
if (ret != NULL) {
/* string shouldn't end with \003 or it could
mess up the next one or two characters */
int diff;
int len = strlen(ret);
while (len > 0 && ret[len-1] == 3) len--;
diff = strlen(ret)-len;
g_string_append(out, ret);
if (diff > 0)
g_string_truncate(out, out->len-diff);
if (need_free) g_free(ret);
}
code = 0;