sabotage-linux / netbsd-curses

libcurses and dependencies taken from netbsd and brought into a portable shape (at least to musl or glibc)
Other
147 stars 14 forks source link

CANCELLED_STRING #38

Closed jeremybobbin closed 4 years ago

jeremybobbin commented 4 years ago

Regarding: libterminfo/term_private.h:75: #define CANCELLED_STRING (char *)(-1)

(char *)(-1) evaluates to 0xffffffffffff or 16^16.

If an application calls ti_getstr with a bad ID string, it returns 0xffffffffffff. Is this the intended behavior? How should an end user of this library handle this error?

Thanks

rofl0r commented 4 years ago

https://linux.die.net/man/3/tigetstr

The tigetstr routine returns the value (char *)-1 if capname is not a string capability, or 0 if it is canceled or absent from the terminal description.

appears to be the expected return value.