mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::rfc1035: Case transform to lower in make_name().
This commit is contained in:
parent
3dfb593dec
commit
d9a770ba3e
1 changed files with 7 additions and 1 deletions
|
@ -433,6 +433,7 @@ ircd::rfc1035::make_name(const mutable_buffer &out,
|
|||
*pos = '\0';
|
||||
ircd::tokens(fqdn, '.', [&pos, &out](const string_view &label)
|
||||
{
|
||||
thread_local char labelbuf[LABEL_MAX+1];
|
||||
if(unlikely(size(label) > LABEL_MAX))
|
||||
throw error
|
||||
{
|
||||
|
@ -442,7 +443,12 @@ ircd::rfc1035::make_name(const mutable_buffer &out,
|
|||
|
||||
*pos++ = size(label);
|
||||
*pos = '\0';
|
||||
pos += strlcpy(pos, label, std::distance(pos, end(out)));
|
||||
pos += strlcpy
|
||||
{
|
||||
pos,
|
||||
tolower(labelbuf, label),
|
||||
std::distance(pos, end(out))
|
||||
};
|
||||
});
|
||||
|
||||
// The null terminator is included in the returned buffer view
|
||||
|
|
Loading…
Reference in a new issue