Skip to content

Commit

Permalink
fix issue #12
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillsaidov committed Jul 16, 2024
1 parent 7114d93 commit 0138722
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/vita/util/argopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,15 @@ static void vt_argopt_assign_value(vt_argopt_t *const opt, const char *const val

// check if we need to allocate
if (*zvalue == NULL) {
*zvalue = strdup(value);
const size_t len = strlen(value);

// allocate buffer
*zvalue = alloctr
? VT_ALLOCATOR_ALLOC(alloctr, len + 1)
: VT_CALLOC(len + 1);

// copy value
strncat(*zvalue, value, len);
} else {
const size_t len = strlen(value);
const size_t zLen = strlen(*zvalue);
Expand Down

0 comments on commit 0138722

Please sign in to comment.