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
76098ee1
Commit
76098ee1
authored
Oct 29, 2012
by
Lorenz Meier
Browse files
Fixed incorrect parameter key/name length termination, was one char too early
parent
0f136442
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/uas/UAS.cc
View file @
76098ee1
...
@@ -2263,18 +2263,13 @@ void UAS::setParameter(const int component, const QString& id, const QVariant& v
...
@@ -2263,18 +2263,13 @@ void UAS::setParameter(const int component, const QString& id, const QVariant& v
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
p
.
param_id
);
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
p
.
param_id
);
i
++
)
{
{
// String characters
// String characters
if
((
int
)
i
<
id
.
length
()
&&
i
<
(
sizeof
(
p
.
param_id
)
-
1
)
)
if
((
int
)
i
<
id
.
length
())
{
{
p
.
param_id
[
i
]
=
id
.
toAscii
()[
i
];
p
.
param_id
[
i
]
=
id
.
toAscii
()[
i
];
}
}
// // Null termination at end of string or end of buffer
// else if ((int)i == id.length() || i == (sizeof(p.param_id) - 1))
// {
// p.param_id[i] = '\0';
// }
// Zero fill
else
else
{
{
// Fill rest with zeros
p
.
param_id
[
i
]
=
0
;
p
.
param_id
[
i
]
=
0
;
}
}
}
}
...
...
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