Browse Source

Explicitly convert pointer to reallocated memory for cvec to compile with a g++ and to remove possible undefined behaviour

master
parent
commit
fe78b79ab7
  1. 2
      src/cvec.c

2
src/cvec.c

@ -39,7 +39,7 @@ void cvec_put(cvec* vec, const void* data) {
}
if (vec->size == vec->cap) {
vec->contents = realloc(vec->contents, vec->cap + vec->data_size);
vec->contents = (char*) realloc(vec->contents, vec->cap + vec->data_size);
}
for (size_t i = 0; i < vec->data_size; i++) {

Loading…
Cancel
Save