Commit eb5b276d authored by Marcin Siodelski's avatar Marcin Siodelski

[2491] Use insert instead of memcpy to append to a vector.

parent 15727822
......@@ -236,11 +236,9 @@ OptionDataTypeUtil::writeFqdn(const std::string& fqdn,
isc::dns::Name name(fqdn);
isc::dns::LabelSequence labels(name);
if (labels.getDataLength() > 0) {
buf.resize(buf.size() + labels.getDataLength());
size_t read_len = 0;
const uint8_t* data = labels.getData(&read_len);
memcpy(static_cast<void*>(&buf[buf.size() - read_len]),
data, read_len);
buf.insert(buf.end(), data, data + read_len);
}
} catch (const isc::Exception& ex) {
isc_throw(BadDataTypeCast, ex.what());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment