Commit d5701e84 authored by Simon Morlat's avatar Simon Morlat
Browse files

Fix gcc12 warning.

1 merge request!173Fix gcc12 warning.
Showing with 2 additions and 1 deletion
......@@ -1508,6 +1508,7 @@ char * bctbx_concat(const char *str, ...) {
/* Resize the allocated memory if necessary. */
if (wp + len + 1 > result + allocated)
{
intptr_t current_offset = wp - result;
allocated = (allocated + len) * 2;
newp = (char *) realloc (result, allocated);
if (newp == NULL)
......@@ -1515,7 +1516,7 @@ char * bctbx_concat(const char *str, ...) {
free (result);
return NULL;
}
wp = newp + (wp - result);
wp = newp + current_offset;
result = newp;
}
memcpy (wp, s, len);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment