Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 345 Bytes
use c_types::*;
#[linkage = "weak"]
#[no_mangle]
pub unsafe extern "C" fn stpcpy(dest: *mut c_schar, source: *const c_schar) -> *mut c_schar {
// TODO(adam) compare and copy as word-size chunks
for i in 0.. {
*dest.offset(i) = *source.offset(i);
if *dest.offset(i) == 0 {
break;
}
}
dest
}