[PATCH 0/1] MR3947: wordpad: Use the wcsdup function instead of reimplementing it.
From: Alex Henrie <alexhenrie24(a)gmail.com> --- 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++; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3947
participants (2)
-
Alex Henrie -
Alex Henrie (@alexhenrie)