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))
|
||||
throw std::runtime_error("Host name too long");
|
||||
|
||||
memcpy(buffer, eh.host.data(), eh.host.size());
|
||||
buffer[eh.host.size()] = 0;
|
||||
*std::copy(eh.host.begin(), eh.host.end(), buffer) = 0;
|
||||
host = buffer;
|
||||
|
||||
#ifndef _WIN32
|
||||
|
|
Loading…
Reference in New Issue