Skip to content

Commit

Permalink
fix -Wsign-compare in BIT_STRING_jer
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfurlan authored and mouse07410 committed Nov 21, 2024
1 parent 18e5650 commit a20d29a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions skeletons/BIT_STRING_jer.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ BIT_STRING_encode_jer(const asn_TYPE_descriptor_t *td,
}
int wr = snprintf(scratch, sizeof(scratch), "%lu",
st->size * 8 - (st->bits_unused));
if(wr < 0 || wr >= sizeof(scratch)) {
if(wr < 0 || (size_t)wr >= sizeof(scratch)) {
ASN__ENCODE_FAILED;
}
ASN__CALLBACK(scratch, wr);
Expand Down Expand Up @@ -283,7 +283,7 @@ BIT_STRING_decode_jer(const asn_codec_ctx_t *opt_codec_ctx,

SKIPCHAR('}');
} else {
if(st->size * 8 < cts->size) {
if(st->size * 8 < (size_t)cts->size) {
RETURN(RC_FAIL);
}
st->bits_unused = (st->size * 8) - cts->size;
Expand Down

0 comments on commit a20d29a

Please sign in to comment.