Module: wine Branch: master Commit: 4059c6ece270f565248da25549c4ced51bcd03b3 URL: https://gitlab.winehq.org/wine/wine/-/commit/4059c6ece270f565248da25549c4ced...
Author: Alex Henrie alexhenrie24@gmail.com Date: Sun Sep 24 12:31:24 2023 -0600
wordpad: Use the wcsdup function instead of reimplementing it.
---
programs/wordpad/wordpad.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index ed55a1d2268..042cc04f4ad 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -627,8 +627,7 @@ static void add_font(struct font_array *fonts, LPCWSTR fontName, DWORD fontType, fontHeight = ntmc->ntmTm.tmHeight - ntmc->ntmTm.tmInternalLeading;
idx = fonts->count; - fonts->fonts[idx].name = malloc((lstrlenW(fontName) + 1)*sizeof(WCHAR) ); - lstrcpyW( fonts->fonts[idx].name, fontName ); + fonts->fonts[idx].name = wcsdup(fontName); fonts->fonts[idx].lParam = MAKELONG(fontType, fontHeight);
fonts->count++;