1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

Merge pull request #399 from Heather/fx1

This commit is contained in:
Alex Lyon 2014-09-23 22:12:29 -07:00
commit cb773c63cf

View file

@ -48,7 +48,7 @@ mod platform {
mod platform { mod platform {
pub use super::libc; pub use super::libc;
use std::mem; use std::mem;
use std::str; use std::string;
extern "system" { extern "system" {
pub fn GetUserNameA(out: *mut libc::c_char, len: *mut libc::uint32_t) -> libc::uint8_t; 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 { if !GetUserNameA(buffer.as_mut_ptr(), &mut (buffer.len() as libc::uint32_t)) == 0 {
crash!(1, "username is too long"); crash!(1, "username is too long");
} }
str::raw::from_c_str(buffer.as_ptr()) string::raw::from_buf(buffer.as_ptr() as *const u8)
} }
} }