mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
dataman: allow writing empty items with nullptr pointer to data
This commit is contained in:
parent
a6cf04a6ff
commit
4ad435b483
@ -324,7 +324,9 @@ _write(dm_item_t item, unsigned char index, dm_persitence_t persistence, const v
|
||||
buffer[1] = persistence;
|
||||
buffer[2] = 0;
|
||||
buffer[3] = 0;
|
||||
memcpy(buffer + DM_SECTOR_HDR_SIZE, buf, count);
|
||||
if (count > 0) {
|
||||
memcpy(buffer + DM_SECTOR_HDR_SIZE, buf, count);
|
||||
}
|
||||
count += DM_SECTOR_HDR_SIZE;
|
||||
|
||||
len = -1;
|
||||
|
||||
@ -133,7 +133,7 @@ extern "C" {
|
||||
in this header, but till I find it a better home here it is */
|
||||
|
||||
typedef struct {
|
||||
char current_offboard_waypoint_id; /* the index of the active offboard waypoint data */
|
||||
char offboard_waypoint_id; /* the index of the active offboard waypoint data */
|
||||
/* (DM_KEY_WAYPOINTS_OFFBOARD_n) or -1 for none */
|
||||
} persistent_system_state_t;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user