mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 23:43:34 +08:00
dataman: allow writing empty items with nullptr pointer to data
This commit is contained in:
@@ -324,7 +324,9 @@ _write(dm_item_t item, unsigned char index, dm_persitence_t persistence, const v
|
|||||||
buffer[1] = persistence;
|
buffer[1] = persistence;
|
||||||
buffer[2] = 0;
|
buffer[2] = 0;
|
||||||
buffer[3] = 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;
|
count += DM_SECTOR_HDR_SIZE;
|
||||||
|
|
||||||
len = -1;
|
len = -1;
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ extern "C" {
|
|||||||
in this header, but till I find it a better home here it is */
|
in this header, but till I find it a better home here it is */
|
||||||
|
|
||||||
typedef struct {
|
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 */
|
/* (DM_KEY_WAYPOINTS_OFFBOARD_n) or -1 for none */
|
||||||
} persistent_system_state_t;
|
} persistent_system_state_t;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user