mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
update whoami syntax for windows
This commit is contained in:
parent
66713ba4b4
commit
4e1aab25c3
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ mod platform {
|
|||
mod platform {
|
||||
pub use super::libc;
|
||||
use std::mem;
|
||||
use std::str;
|
||||
use std::string;
|
||||
|
||||
extern "system" {
|
||||
pub fn GetUserNameA(out: *mut libc::c_char, len: *mut libc::uint32_t) -> libc::uint8_t;
|
||||
|
@ -60,7 +60,7 @@ mod platform {
|
|||
if !GetUserNameA(buffer.as_mut_ptr(), &mut (buffer.len() as libc::uint32_t)) == 0 {
|
||||
crash!(1, "username is too long");
|
||||
}
|
||||
str::raw::from_c_str(buffer.as_ptr())
|
||||
string::raw::from_buf(buffer.as_ptr() as *const u8)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue