Skip to content

Commit

Permalink
Replaced 'assert()' with 'rz_return_val_if_fail()' (#3813)
Browse files Browse the repository at this point in the history
Partially fixes #3778
  • Loading branch information
ezinneanne authored Sep 8, 2023
1 parent 0d70da2 commit fa0b818
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion librz/util/buf_sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static bool buf_sparse_resize(RzBuffer *b, ut64 newsize) {
RzBufferSparseChunk *c = rz_vector_index_ptr(&priv->chunks, n - 1);
if (newsize <= c->to) {
// must chop the now-last block
assert(newsize); // newsize > 0 is guaranteed when n > 0, otherwise the lower bound above would have returned 0.
rz_return_val_if_fail(newsize, false); // newsize > 0 is guaranteed when n > 0, otherwise the lower bound above would have returned 0.
c->to = newsize - 1;
ut8 *tmp = realloc(c->data, c->to - c->from + 1);
if (tmp) {
Expand Down

0 comments on commit fa0b818

Please sign in to comment.