Re: [PATCH v8 0/1] MR5373: shell32: Implement FCIDM_SHVIEW_CREATELINK
Sven Baars (@sbaars) commented about dlls/shell32/shlview_cmenu.c:
+ WCHAR *link_filename; + + if (counter == 1) + { + static const WCHAR *fmt = L"%s - %s.lnk"; + int length = wcslen(filename) + wcslen(shortcutW) + 7; /* length of the format*/ + link_filename = malloc((length + 1) * sizeof(WCHAR)); + wsprintfW(link_filename, fmt, filename, shortcutW); + } + else + { + static const WCHAR *fmt = L"%s - %s (%s).lnk"; + int length = wcslen(filename) + wcslen(shortcutW) + 10; /* length of the format*/ + WCHAR counter_string[34]; + wsprintfW(counter_string, L"%i", counter); + length += wcslen(counter_string); `wsprintfW` also returns the length of the string by the way.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5373#note_121809
participants (1)
-
Sven Baars (@sbaars)