Browse Source

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

master
parent
commit
4db9c32635
  1. 2
      src/datastruct/cvec.c

2
src/datastruct/cvec.c

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

Loading…
Cancel
Save