Cleanup allocation functions

This commit is contained in:
Jeremy Soller
2018-07-03 19:40:47 -06:00
parent b6b34a7026
commit 42abc98a99
4 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -191,7 +191,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 = platform::alloc(len + 1, 16, 8) as *mut c_char;
let buffer = platform::alloc(len + 1) as *mut c_char;
if buffer.is_null() {
platform::errno = ENOMEM as c_int;
} else {