mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
zenoh: Handle parsing errors in config
This commit is contained in:
committed by
Beat Küng
parent
40bba0069d
commit
70536766db
@@ -276,9 +276,14 @@ int Zenoh_Config::getPubSubMapping(char *topic, char *type, const char *filename
|
|||||||
const char *config_type = get_csv_field(buffer, 2);
|
const char *config_type = get_csv_field(buffer, 2);
|
||||||
const char *config_topic = get_csv_field(buffer, 1);
|
const char *config_topic = get_csv_field(buffer, 1);
|
||||||
|
|
||||||
strncpy(type, config_type, TOPIC_INFO_SIZE);
|
if (config_topic && config_type) {
|
||||||
strncpy(topic, config_topic, TOPIC_INFO_SIZE);
|
strncpy(type, config_type, TOPIC_INFO_SIZE);
|
||||||
return 1;
|
strncpy(topic, config_topic, TOPIC_INFO_SIZE);
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user