Skip to content

Commit

Permalink
msg: print format string on format errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper93 authored and sfan5 committed Sep 29, 2024
1 parent 96006fa commit 4c19df1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,10 @@ void mp_msg_va(struct mp_log *log, int lev, const char *format, va_list va)
bstr_xappend(root, &root->buffer, log->partial[lev]);
log->partial[lev].len = 0;

bstr_xappend_vasprintf(root, &root->buffer, format, va);
if (bstr_xappend_vasprintf(root, &root->buffer, format, va) < 0) {
bstr_xappend(root, &root->buffer, bstr0("format error: "));
bstr_xappend(root, &root->buffer, bstr0(format));
}

// Remember last status message and restore it to ensure that it is
// always displayed
Expand Down

0 comments on commit 4c19df1

Please sign in to comment.