[][src]Function tinyrlibc::atoi

#[no_mangle]
pub unsafe extern "C" fn atoi(s: *const CChar) -> CInt

Converts a null-terminated string representing a decimal integer, into an integer. No indication of error.

use tinyrlibc::atoi;
assert_eq!(unsafe { atoi(b"123".as_ptr()) }, 123);
assert_eq!(unsafe { atoi(b"123x".as_ptr()) }, 123);
assert_eq!(unsafe { atoi(b"".as_ptr()) }, 0);