greyblake / whatlang-ffi

C bindings for whatlang Rust library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check NULL pointer

greyblake opened this issue · comments

Details are in this comment:
https://www.reddit.com/r/rust/comments/6sosp0/porting_a_rust_library_to_c/dleg19i/

Also, that whatlang_detect argument should be char const *text. And you should not map struct whatlang_info * to &mut Info: C allows null pointers, Rust does not. The Rust side should be *mut Info with an explicit check for null.