libobs/util: Make sure to set capacity in dstr_ncopy* funcs

This commit is contained in:
jp9000 2016-03-15 20:19:47 -07:00
parent 45a2fa0e1a
commit ae8b4bc538

View File

@ -346,6 +346,7 @@ void dstr_ncopy(struct dstr *dst, const char *array, const size_t len)
dst->array = bmemdup(array, len + 1);
dst->len = len;
dst->capacity = len + 1;
dst->array[len] = 0;
}
@ -363,6 +364,7 @@ void dstr_ncopy_dstr(struct dstr *dst, const struct dstr *str, const size_t len)
newlen = size_min(len, str->len);
dst->array = bmemdup(str->array, newlen + 1);
dst->len = newlen;
dst->capacity = newlen + 1;
dst->array[newlen] = 0;
}