Skip to content

Instantly share code, notes, and snippets.

@brson
Created February 28, 2012 00:53
Show Gist options
  • Save brson/1928234 to your computer and use it in GitHub Desktop.
Save brson/1928234 to your computer and use it in GitHub Desktop.
fn from_cstrs(cstrs: *str::sbuf, n: uint) -> [str] unsafe {
let curr = cstrs;
let result = [];
let i = 0u;
while i < n {
result += [str::from_cstr(*curr)];
curr = ptr::offset(cstrs, i);
i += 1u;
}
ret result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment