History

msg: print format string on format errors

Kacper Michajłow committed 2 years ago

Commit 4c19df11 parent 96006fa1 file · +4 −1Browse files

Unified · Split

common/msg.c+4−1
@@ -570,7 +570,10 @@ void mp_msg_va(struct mp_log *log, int lev, const char *format, va_list va) · 569 unmodified lines
570570 bstr_xappend(root, &root->buffer, log->partial[lev]);
571571 log->partial[lev].len = 0;
572572
573− bstr_xappend_vasprintf(root, &root->buffer, format, va);
573+ if (bstr_xappend_vasprintf(root, &root->buffer, format, va) < 0) {
574+ bstr_xappend(root, &root->buffer, bstr0("format error: "));
575+ bstr_xappend(root, &root->buffer, bstr0(format));
576+ }
574577
575578 // Remember last status message and restore it to ensure that it is
576579 // always displayed

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t