|
|
@ -86,13 +86,10 @@ int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size) |
|
|
|
new_size = max(strbuff->size * STRBUFFER_FACTOR, |
|
|
|
new_size = max(strbuff->size * STRBUFFER_FACTOR, |
|
|
|
strbuff->length + size + 1); |
|
|
|
strbuff->length + size + 1); |
|
|
|
|
|
|
|
|
|
|
|
new_value = jsonp_malloc(new_size); |
|
|
|
new_value = realloc(strbuff->value, new_size); |
|
|
|
if(!new_value) |
|
|
|
if(!new_value) |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
|
|
memcpy(new_value, strbuff->value, strbuff->length); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jsonp_free(strbuff->value); |
|
|
|
|
|
|
|
strbuff->value = new_value; |
|
|
|
strbuff->value = new_value; |
|
|
|
strbuff->size = new_size; |
|
|
|
strbuff->size = new_size; |
|
|
|
} |
|
|
|
} |
|
|
|