Skip to content

Commit

Permalink
Resolved support for indefinite array and maap support
Browse files Browse the repository at this point in the history
  • Loading branch information
nagrawal63 committed Aug 18, 2020
1 parent 3a672f7 commit 442bfb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ bool nanocbor_at_end(const nanocbor_value_t *it)
end = true;
}
else if (nanocbor_container_indefinite(it) &&
*it->cur == (NANOCBOR_TYPE_FLOAT | NANOCBOR_SIZE_INDEFINITE)) {
*it->cur == (NANOCBOR_TYPE_FLOAT << NANOCBOR_TYPE_OFFSET | NANOCBOR_VALUE_MASK)) {
end = true;
}
else if (nanocbor_in_container(it) && it->remaining == 0) {
else if (!nanocbor_container_indefinite(it) && nanocbor_in_container(it) && it->remaining == 0) {
end = true;
}
return end;
Expand Down Expand Up @@ -226,7 +226,7 @@ int _enter_container(nanocbor_value_t *it, nanocbor_value_t *container,
container->end = it->end;
container->remaining = 0;

if (_value_match_exact(it, type | NANOCBOR_VALUE_MASK) == 1) {
if (_value_match_exact(it, (type << NANOCBOR_TYPE_OFFSET | NANOCBOR_SIZE_INDEFINITE)) == 1) {
container->flags = NANOCBOR_DECODER_FLAG_INDEFINITE |
NANOCBOR_DECODER_FLAG_CONTAINER;
container->cur = it->cur;
Expand Down

0 comments on commit 442bfb9

Please sign in to comment.