1
0
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:
ailin-nemui 2020-05-08 15:42:55 +02:00 committed by GitHub
commit 784373a7b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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, "}");