mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Fix embedded NULs in C wide strings returned from Windows API (#2264)
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
use std::{
|
||||
ffi::OsString,
|
||||
mem::{self, size_of},
|
||||
os::windows::prelude::OsStringExt,
|
||||
ptr,
|
||||
};
|
||||
|
||||
@@ -129,7 +127,7 @@ pub fn get_raw_input_device_name(handle: HANDLE) -> Option<String> {
|
||||
|
||||
unsafe { name.set_len(minimum_size as _) };
|
||||
|
||||
OsString::from_wide(&name).into_string().ok()
|
||||
util::decode_wide(&name).into_string().ok()
|
||||
}
|
||||
|
||||
pub fn register_raw_input_devices(devices: &[RAWINPUTDEVICE]) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user