Skip to content

Commit 018b447

Browse files
committed
Text and binary mode: Fix array deserialization
1 parent 1a09e22 commit 018b447

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/thingset_bin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ static int bin_deserialize_value(struct thingset_context *ts,
652652
break;
653653
}
654654
index++;
655-
} while (index < array->num_elements);
655+
} while (index < array->max_elements);
656656

657657
if (!check_only) {
658658
array->num_elements = index;

src/thingset_txt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,15 @@ static int txt_deserialize_value(struct thingset_context *ts,
672672
break;
673673
}
674674
index++;
675-
} while (index < array->num_elements);
675+
} while (index < array->max_elements);
676676

677677
if (!check_only) {
678678
array->num_elements = index;
679679
}
680+
681+
if (err == -THINGSET_ERR_DESERIALIZATION_FINISHED) {
682+
err = 0;
683+
};
680684
}
681685

682686
return err;

0 commit comments

Comments
 (0)