aboutsummaryrefslogtreecommitdiff
path: root/src/modules/dataman
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/dataman')
-rw-r--r--src/modules/dataman/dataman.c4
-rw-r--r--src/modules/dataman/dataman.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/dataman/dataman.c b/src/modules/dataman/dataman.c
index 96dc98f2a..14fee7c9a 100644
--- a/src/modules/dataman/dataman.c
+++ b/src/modules/dataman/dataman.c
@@ -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;
diff --git a/src/modules/dataman/dataman.h b/src/modules/dataman/dataman.h
index f2b6cd4d3..b25a2a5ef 100644
--- a/src/modules/dataman/dataman.h
+++ b/src/modules/dataman/dataman.h
@@ -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;