dataman: allow writing empty items with nullptr pointer to data

This commit is contained in:
Anton Babushkin
2014-06-09 16:09:03 +02:00
parent a6cf04a6ff
commit 4ad435b483
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -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;