Skip to content

Commit

Permalink
FIX: allow bincode/init size value to be zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jan 21, 2023
1 parent dc9401a commit a14b4b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/u-bincode.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static REBCNT EncodedU32_Size(u32 value) {
break;
case REB_INTEGER:
//printf("resize from %i, needs %i\n", SERIES_REST(bin), VAL_INT32(val_spec));
if (VAL_INT64(val_spec) <= 0 || VAL_UNT64(val_spec) >= MAX_U32)
if (VAL_INT64(val_spec) < 0 || VAL_UNT64(val_spec) >= MAX_U32)
Trap1(RE_INVALID_ARG, val_spec);
if (VAL_UNT32(val_spec) > SERIES_REST(bin)){
Expand_Series(bin, AT_TAIL, VAL_INT32(val_spec) - SERIES_TAIL(bin) - 1 );
Expand Down

0 comments on commit a14b4b7

Please sign in to comment.