Skip to content

Commit

Permalink
Fix unsigned int treated as int.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyaraj-23 committed Feb 12, 2024
1 parent 7832b7f commit 43d39dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/parser/operation_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ tz_step_size(tz_parser_state *state)
tz_raise(TOO_LARGE); // enforce 16-bit restriction
op->frame->step_size.size = op->frame->step_size.size << 8 | b;
op->frame->step_size.size_len--;
if (op->frame->step_size.size_len <= 0) {
if (op->frame->step_size.size_len == 0) {
op->frame[-1].stop = state->ofs + op->frame->step_size.size;
tz_must(pop_frame(state));
}
Expand Down Expand Up @@ -582,7 +582,7 @@ tz_step_read_int32(tz_parser_state *state)
*value = *value << 8 | b;
op->frame->step_read_int32.ofs++;
} else {
snprintf((char *)CAPTURE, sizeof(CAPTURE), "%d", *value);
snprintf((char *)CAPTURE, sizeof(CAPTURE), "%u", *value);
op->frame->step_read_string.skip = op->frame->step_read_int32.skip;
tz_must(tz_print_string(state));
}
Expand Down

0 comments on commit 43d39dc

Please sign in to comment.