Christoph Ender wrote:
I've noticed that output of non-ASCII chars using a self-compiled ncurses 5.9
(the only
compile-option being --enable-widec) or the MacPorts binary package of ncurses,
also in
version 5.9, results in an errno=1.
echo_wchar(&wcval);
e2 = errno;
e2: 1
does anyone by chance have an idea what might be the cause?
<http://pubs.opengroup.org/onlinepubs/009695399/functions/errno.html>:
| The value of errno shall be defined only after a call to a function
| for which it is explicitly stated to be set [...]. The value of
| errno should only be examined when it is indicated to be valid by
| a function's return value.
<http://pubs.opengroup.org/onlinepubs/007908799/xcurses/echo_wchar.html>:
| RETURN VALUE
| Upon successful completion, these functions return OK. Otherwise,
| they return ERR.
| ERRORS
| No errors are defined.
So, to detect errors, you should check for echo_wchar() itself returning
ERR, and even then, the value of errno is not defined.