Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
1191018a
Commit
1191018a
authored
Apr 28, 2015
by
Don Gagne
Browse files
Fix null termination
parent
671da5a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/MockLink.cc
View file @
1191018a
...
...
@@ -503,11 +503,14 @@ void MockLink::_handleParamSet(const mavlink_message_t& msg)
Q_ASSERT
(
request
.
target_system
==
_vehicleSystemId
);
int
componentId
=
request
.
target_component
;
// Param may not be null terminated if exactly fits
char
paramId
[
MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN
+
1
];
paramId
[
MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN
]
=
0
;
strncpy
(
paramId
,
request
.
param_id
,
MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN
);
qCDebug
(
MockLinkLog
)
<<
"_handleParamSet"
<<
componentId
<<
paramId
<<
request
.
param_type
;
Q_ASSERT
(
_mapParamName2Value
.
contains
(
componentId
));
Q_ASSERT
(
_mapParamName2Value
[
componentId
].
contains
(
paramId
));
Q_ASSERT
(
request
.
param_type
==
_mapParamName2MavParamType
[
paramId
]);
...
...
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