Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_text_input.c:
- pthread_mutex_lock(&text_input->mutex);
- assert(text_input->wl_surface);
- hwnd = wl_surface_get_user_data(text_input->wl_surface);
- commit_len = strlen(text_input->commit_string);
- if (!(output = malloc((commit_len + 1) * sizeof(WCHAR))))
- {
ERR("Failed to allocate memory for wide IME commit string.\n");
goto done;
- }
- len = ntdll_umbstowcs(text_input->commit_string, commit_len, output, commit_len);
- output[len] = 0;
- post_ime_update(hwnd, 0, NULL, output);
- free(output);
Let's ignore allocation failures and use an `strdupAtoW` helper like you have later.
```suggestion:-15+0 wide_commit = strdupAtoW(text_input->commit_string); post_ime_update(hwnd, 0, NULL, wide_commit); free(wide_commit); ```
Edit: You should rename the output variable to wide_commit already here if you're going to do that later.