27 Jul
2022
27 Jul
'22
6:40 a.m.
R��mi Bernon (@rbernon) commented about programs/winedbg/gdbproxy.c:
reply_buffer_append(reply, str, strlen(str)); }
+static inline void reply_buffer_append_wstr(struct reply_buffer* reply, const WCHAR* wstr) +{ + char* str; + int len; + + len = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); + str = malloc(len); + if (WideCharToMultiByte(CP_ACP, 0, wstr, -1, str, len, NULL, NULL)) + reply_buffer_append_str(reply, str);
This could maybe handle allocation failure more gracefully, skipping the append? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/541#note_5016