We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 369afa5 commit 366250eCopy full SHA for 366250e
src/symbolize/gimli/libs_windows.rs
@@ -80,14 +80,14 @@ unsafe fn get_posix_path(long_path: &[u16]) -> Option<OsString> {
80
return None;
81
}
82
let name_len = name_len as usize;
83
- let mut name_buffer = vec![0_u8; name_len];
+ let mut name_buffer = Vec::with_capacity(name_len);
84
// Safety: `name_buffer` is large enough.
85
let res = unsafe {
86
cygwin_conv_path(
87
CCP_WIN_W_TO_POSIX,
88
long_path.as_ptr(),
89
name_buffer.as_mut_ptr(),
90
- name_buffer.len(),
+ name_len,
91
)
92
};
93
// It's not likely to return error here.
0 commit comments