From 723212bd8c86b1b27cf7c1ac1c90ef2b2408ddd7 Mon Sep 17 00:00:00 2001 From: Arcterus Date: Sun, 15 Jun 2014 14:42:58 -0700 Subject: [PATCH] whoami: change GetUserName to GetUserNameA --- whoami/whoami.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whoami/whoami.rs b/whoami/whoami.rs index be9325863..cedb32778 100644 --- a/whoami/whoami.rs +++ b/whoami/whoami.rs @@ -52,13 +52,13 @@ mod platform { use std::str; extern "system" { - pub fn GetUserName(out: *libc::c_char, len: *libc::uint32_t) -> libc::uint8_t; + pub fn GetUserNameA(out: *libc::c_char, len: *libc::uint32_t) -> libc::uint8_t; } #[allow(unused_unsafe)] pub unsafe fn getusername() -> String { let buffer: [libc::c_char, ..2048] = mem::uninitialized(); // XXX: it may be possible that this isn't long enough. I don't know - if !GetUserName(buffer.as_ptr(), &(buffer.len() as libc::uint32_t)) == 0 { + if !GetUserNameA(buffer.as_ptr(), &(buffer.len() as libc::uint32_t)) == 0 { crash!(1, "username is too long"); } str::raw::from_c_str(buffer.as_ptr())