[PATCH 08/11] winemac: Don't use sprintfW in copy_system_cursor_name.

Jacek Caban wine at gitlab.winehq.org
Thu Jun 2 19:51:23 CDT 2022


From: Jacek Caban <jacek at codeweavers.com>

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
---
 dlls/winemac.drv/mouse.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c
index 00ec9a36c38..18a98296a76 100644
--- a/dlls/winemac.drv/mouse.c
+++ b/dlls/winemac.drv/mouse.c
@@ -166,7 +166,6 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags,
  */
 CFStringRef copy_system_cursor_name(ICONINFOEXW *info)
 {
-    static const WCHAR idW[] = {'%','h','u',0};
     const struct system_cursors *cursors;
     unsigned int i;
     CFStringRef cursor_name = NULL;
@@ -184,7 +183,12 @@ CFStringRef copy_system_cursor_name(ICONINFOEXW *info)
     p = name + strlenW(name);
     *p++ = ',';
     if (info->szResName[0]) strcpyW(p, info->szResName);
-    else sprintfW(p, idW, info->wResID);
+    else
+    {
+        char buf[16];
+        sprintf(buf, "%hu", info->wResID);
+        asciiz_to_unicode(p, buf);
+    }
 
     /* @@ Wine registry key: HKCU\Software\Wine\Mac Driver\Cursors */
     if (!(key = open_hkcu_key("Software\\Wine\\Mac Driver\\Cursors")))
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/177



More information about the wine-devel mailing list