[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
delwin: Solaris curses vs. ncurses
From: |
Neil Zanella |
Subject: |
delwin: Solaris curses vs. ncurses |
Date: |
Sat, 28 Oct 2000 01:48:34 -0230 (NDT) |
Hello,
While I cannot claim that this is a bug this is yet another example of
how behavior under Solaris curses differs from behavior under ncurses 5.1.
The XSI man pages states that delwin returns OK upon success and ERR upon
failure but does not state in which cases it should fail. Hence I made
up the following test program to see what would happen if I tried to
delete a nonexisting window. The results were:
ncurses 5.1:
Let's try to delete a nonexisting window.
Return code was OK.
Hit <Enter> to exit.
Solaris 5.7 curses:
Let's try to delete a nonexisting window.
Segmentation Fault
I thought that ncurses should perhaps at least return ERR (maybe).
Thanks!
Neil
And here is the test program:
#include <curses.h>
int main()
{
WINDOW *hello;
int code;
initscr(); cbreak(); noecho();
addstr("Let's try to delete a nonexisting window.\n");
getch();
code = delwin(hello);
if (code == ERR)
addstr("Return code was ERR.\n");
else if (code == OK)
addstr("Return code was OK.\n");
else
addstr("Unknown return code.\n");
addstr("Hit <Enter> to exit.");
getch();
endwin();
}
- delwin: Solaris curses vs. ncurses,
Neil Zanella <=