Added SdlResult and switched to StrBuf

This commit is contained in:
Vladimir Matveev
2014-05-26 19:49:02 +04:00
parent 1d0d67f6c8
commit 304a95431c
+3 -3
View File
@@ -1,5 +1,6 @@
use std::mem;
use std::str;
use std::c_str::CString;
// Setup linking for all targets.
#[cfg(target_os="macos")]
@@ -113,9 +114,8 @@ pub fn was_inited(flags: InitFlag) -> InitFlag {
pub fn get_error() -> String {
unsafe {
let cstr = ll::SDL_GetError();
str::raw::from_c_str(mem::transmute_copy(&cstr))
let cstr = CString::new(ll::SDL_GetError(), false);
cstr.as_str().to_strbuf()
}
}