lib: simplify u16_strdup()

Use u16_strsize() instead of duplicating it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt 2022-04-02 11:46:59 +02:00
parent 0121282d1a
commit 967407defe

View File

@ -407,7 +407,7 @@ u16 *u16_strdup(const void *src)
if (!src)
return NULL;
len = (u16_strlen(src) + 1) * sizeof(u16);
len = u16_strsize(src);
new = malloc(len);
if (!new)
return NULL;