Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
eb5b276d
Commit
eb5b276d
authored
Dec 10, 2012
by
Marcin Siodelski
Browse files
[2491] Use insert instead of memcpy to append to a vector.
parent
15727822
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/option_data_types.cc
View file @
eb5b276d
...
...
@@ -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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment