]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lib: simplify u16_strdup()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 2 Apr 2022 09:46:59 +0000 (11:46 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 15 Apr 2022 09:26:20 +0000 (11:26 +0200)
Use u16_strsize() instead of duplicating it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/charset.c

index 91cbe87509c7d73ea755b497afd7bf7eb0111787..de201cf3b9b4e1cac6e686f0ff4d1ea50cf0cdc9 100644 (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;