cmd: add remote arg

issue #2
This commit is contained in:
tylen
2024-09-26 19:21:17 +00:00
committed by Vasily Davydov
parent 384b5ceb3d
commit 5172da33ac
3 changed files with 9 additions and 2 deletions

View File

@@ -21,8 +21,8 @@ Buffer* buffer_create(size_t capacity) {
void buffer_append(Buffer* buffer, const char* str) {
LOG_DEBUG("Entering function %s", __func__);
size_t len = strlen(str);
if (buffer->size + len >= buffer->capacity) {
buffer->capacity = buffer->size + len;
while (buffer->size + len >= buffer->capacity) {
buffer->capacity *= 2;
buffer->data = (char*)cdo_realloc(buffer->data, buffer->capacity);
}
strcpy(buffer->data + buffer->size, str);