net/Resolver: use std::copy()
This commit is contained in:
parent
242ba727b2
commit
b5a9d0654e
@ -111,8 +111,7 @@ Resolve(const char *host_and_port, int default_port,
|
|||||||
if (eh.host.size() >= sizeof(buffer))
|
if (eh.host.size() >= sizeof(buffer))
|
||||||
throw std::runtime_error("Host name too long");
|
throw std::runtime_error("Host name too long");
|
||||||
|
|
||||||
memcpy(buffer, eh.host.data(), eh.host.size());
|
*std::copy(eh.host.begin(), eh.host.end(), buffer) = 0;
|
||||||
buffer[eh.host.size()] = 0;
|
|
||||||
host = buffer;
|
host = buffer;
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
Loading…
Reference in New Issue
Block a user