mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Merge pull request #1191 from ailin-nemui/null-format
fix NULL assertion in format args
This commit is contained in:
commit
784373a7b3
@ -256,9 +256,9 @@ static char *fallback_format(TEXT_BUFFER_FORMAT_REC *format_rec)
|
||||
char *tmp;
|
||||
bs = g_string_new(NULL);
|
||||
g_string_printf(bs, "{%s#%s", format_rec->module, format_rec->format);
|
||||
for (i = 0; i < format_rec->nargs; i++) {
|
||||
for (i = 0; i < format_rec->nargs && format_rec->args[i] != NULL; i++) {
|
||||
tmp = g_strescape(format_rec->args[i], "");
|
||||
g_string_append_printf(bs, "\"%s\"%s", tmp, i + 1 < format_rec->nargs ? " " : "");
|
||||
g_string_append_printf(bs, " \"%s\"", tmp);
|
||||
g_free(tmp);
|
||||
}
|
||||
g_string_append(bs, "}");
|
||||
|
Loading…
Reference in New Issue
Block a user