tigetstr wrapper is unsafe & provides no way to check for failures
swolchok opened this issue · 2 comments
swolchok commented
A simple attempt to use it segfaults:
fn main() {
let capability = tigetstr("idontexist");
if capability.is_empty() {
println!("empty");
} else {
println!("nonempty");
}
}
tigetstr returns (char *)-1 if the capability doesn't exist, and a null pointer if the capability isn't supported. Neither one seems to be supported by the ncurses-rs wrapper.
jeaye commented
Thanks for reporting this! Have you worked around it or patched it up? A PR would be most appreciated.