mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 23:32:39 +00:00
Merge pull request #399 from Heather/fx1
This commit is contained in:
commit
cb773c63cf
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…
Reference in a new issue