0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-23 13:23:46 +02:00

ircd: Fix possible null directive arguments (-Wformat-truncation gcc-11).

This commit is contained in:
Jason Volk 2022-06-29 13:20:52 -07:00
parent f705df096d
commit c664963e8d
2 changed files with 10 additions and 3 deletions

View file

@ -1277,7 +1277,14 @@ ircd::http::error::error(const http::code &code,
,code{code}
{
auto &buf(ircd::error::buf);
::snprintf(buf, sizeof(buf), "%u %s", uint(code), status(code).c_str());
const auto msg(status(code));
::snprintf
(
buf, sizeof(buf),
"%u %s",
uint(code),
msg? msg.c_str(): ""
);
}
// Out-of-line placement.

View file

@ -354,8 +354,8 @@ ircd::ios::stats_name(const descriptor &d,
(
stats_name_buf, sizeof(stats_name_buf),
"ircd.ios.%s.%s",
d.name.c_str(),
key.c_str()
d.name? d.name.c_str(): "",
key? key.c_str(): ""
))
};
}