mirror of
https://github.com/transmission/transmission
synced 2025-03-11 14:43:42 +00:00
Fix GTK client crash opening message log containing errors (#3711)
`Glib::ustring::sprintf()` doesn't support formatting `std::string_view`.
Use `fmt::format()` instead.
Broken in #3626 (7c5862a5f5
).
This commit is contained in:
parent
377134f475
commit
ccae3d7ccd
1 changed files with 2 additions and 2 deletions
|
@ -362,11 +362,11 @@ tr_log_message* addMessages(Glib::RefPtr<Gtk::ListStore> const& store, tr_log_me
|
|||
/* if it's an error message, dump it to the terminal too */
|
||||
if (i->level == TR_LOG_ERROR)
|
||||
{
|
||||
auto gstr = gtr_sprintf("%s:%d %s", i->file, i->line, i->message);
|
||||
auto gstr = fmt::format("{}:{} {}", i->file, i->line, i->message);
|
||||
|
||||
if (!std::empty(i->name))
|
||||
{
|
||||
gstr += gtr_sprintf(" (%s)", i->name.c_str());
|
||||
gstr += fmt::format(" ({})", i->name.c_str());
|
||||
}
|
||||
|
||||
g_warning("%s", gstr.c_str());
|
||||
|
|
Loading…
Add table
Reference in a new issue