wchar support

This commit is contained in:
Stephan Vedder
2018-07-01 20:59:37 +02:00
committed by jD91mZM2
parent fb09b03acf
commit cc210361d6
34 changed files with 840 additions and 669 deletions
+1 -1
View File
@@ -9,5 +9,5 @@ cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
stdlib = { path = "../stdlib" }
ralloc = { path = "../../ralloc", default-features = false }
errno = { path = "../errno" }
+2 -3
View File
@@ -1,10 +1,9 @@
//! string implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/string.h.html
#![no_std]
extern crate errno;
extern crate platform;
extern crate stdlib;
extern crate ralloc;
use platform::types::*;
use errno::*;
@@ -193,7 +192,7 @@ pub unsafe extern "C" fn strndup(s1: *const c_char, size: usize) -> *mut c_char
let len = strnlen(s1, size);
// the "+ 1" is to account for the NUL byte
let buffer = stdlib::malloc(len + 1) as *mut c_char;
let buffer = ralloc::alloc(len + 1, 1) as *mut c_char;
if buffer.is_null() {
platform::errno = ENOMEM as c_int;
} else {