0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-20 08:51:18 +01:00

ircd:Ⓜ️ Use better constexpr for room_id() stack buffer size.

This commit is contained in:
Jason Volk 2018-09-13 05:00:57 -07:00
parent fad454f3b1
commit 65f87b58bc

View file

@ -2782,14 +2782,16 @@ ircd::m::count_since(const room &r,
ircd::m::id::room::buf ircd::m::id::room::buf
ircd::m::room_id(const id::room_alias &room_alias) ircd::m::room_id(const id::room_alias &room_alias)
{ {
char buf[256]; char buf[m::id::MAX_SIZE + 1];
static_assert(sizeof(buf) <= 256);
return room_id(buf, room_alias); return room_id(buf, room_alias);
} }
ircd::m::id::room::buf ircd::m::id::room::buf
ircd::m::room_id(const string_view &room_id_or_alias) ircd::m::room_id(const string_view &room_id_or_alias)
{ {
char buf[256]; char buf[m::id::MAX_SIZE + 1];
static_assert(sizeof(buf) <= 256);
return room_id(buf, room_id_or_alias); return room_id(buf, room_id_or_alias);
} }