mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 19:53:35 +08:00
Simple mixer: Remove incorrect pre-parser and replace with fixed central implementation
This commit is contained in:
committed by
Daniel Agar
parent
dd05ff5156
commit
b3ce3cbaff
@@ -161,6 +161,11 @@ SimpleMixer::from_text(Mixer::ControlCallback control_cb, uintptr_t cb_handle, c
|
|||||||
int used;
|
int used;
|
||||||
const char *end = buf + buflen;
|
const char *end = buf + buflen;
|
||||||
|
|
||||||
|
/* enforce that the mixer ends with a new line */
|
||||||
|
if (!string_well_formed(buf, buflen)) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
/* get the base info for the mixer */
|
/* get the base info for the mixer */
|
||||||
if (sscanf(buf, "M: %u%n", &inputs, &used) != 1) {
|
if (sscanf(buf, "M: %u%n", &inputs, &used) != 1) {
|
||||||
debug("simple parse failed on '%s'", buf);
|
debug("simple parse failed on '%s'", buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user