mirror of
https://github.com/transmission/transmission.git
synced 2025-12-19 18:08:31 +00:00
refactor: remove tr_snprintf() pt 1 (#2867)
* refactor use fmt instead of tr_snprintf in remote.cc * refactor use fmt instead of tr_snprintf in daemon.cc * refactor use fmt instead of tr_snprintf in cli.cc
This commit is contained in:
@@ -692,9 +692,12 @@ static int daemon_start(void* varg, [[maybe_unused]] bool foreground)
|
||||
|
||||
if (ev_base == nullptr)
|
||||
{
|
||||
char buf[256];
|
||||
tr_snprintf(buf, sizeof(buf), "Couldn't initialize daemon event state: %s", tr_strerror(errno));
|
||||
printMessage(logfile, TR_LOG_ERROR, MyName, buf, __FILE__, __LINE__);
|
||||
auto const error_code = errno;
|
||||
auto const errmsg = fmt::format(
|
||||
_("Couldn't initialize daemon: {error} ({error_code})"),
|
||||
fmt::arg("error", tr_strerror(error_code)),
|
||||
fmt::arg("error_code", error_code));
|
||||
printMessage(logfile, TR_LOG_ERROR, MyName, errmsg, __FILE__, __LINE__);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user