Skip to content
Snippets Groups Projects
Commit d6a7942e authored by Tom Almeida's avatar Tom Almeida
Browse files

Change the type of byteset from [u8] to [usize] in strcspn and strspn....

Change the type of byteset from [u8] to [usize] in strcspn and strspn. Hopefully this is the last bug in these!
parent 13b71199
No related branches found
No related tags found
1 merge request!78Yet another fix for strcspn and strspn.
......@@ -8,6 +8,8 @@ extern crate errno;
extern crate platform;
extern crate stdlib;
pub use compiler_builtins::mem::*;
use platform::types::*;
use errno::*;
use core::cmp;
......@@ -125,7 +127,7 @@ pub unsafe extern "C" fn strcspn(s1: *const c_char, s2: *const c_char) -> c_ulon
// The below logic is effectively ripped from the musl implementation
let mut byteset = [0u8; 32 / mem::size_of::<usize>()];
let mut byteset = [0usize; 32 / mem::size_of::<usize>()];
let mut i = 0;
while *s2.offset(i) != 0 {
......@@ -277,7 +279,7 @@ pub unsafe extern "C" fn strspn(s1: *const c_char, s2: *const c_char) -> c_ulong
// The below logic is effectively ripped from the musl implementation
let mut byteset = [0u8; 32 / mem::size_of::<usize>()];
let mut byteset = [0usize; 32 / mem::size_of::<usize>()];
let mut i = 0;
while *s2.offset(i) != 0 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment