Skip to content

Commit

Permalink
[review] Fixed an Err return value
Browse files Browse the repository at this point in the history
  • Loading branch information
daladim committed Jan 8, 2021
1 parent f0d33a1 commit ad27a49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion heim-host/src/sys/windows/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ fn get_value_from_get_computer_name_ex_w(kind: COMPUTER_NAME_FORMAT) -> Result<S

if size > required_size {
// Should not happen, size "receives the number of TCHARs copied to the destination buffer, not including the terminating null character"
return Err("Invalid value returned by GetComputerNameExW".into());
let e = std::io::Error::new(std::io::ErrorKind::Other, "Invalid value returned by GetComputerNameExW");
return Err(e.into());
}
// buffer[..size] is valid because buffer.len > size already
let str = OsString::from_wide(&buffer[..(size as usize)])
Expand Down

0 comments on commit ad27a49

Please sign in to comment.