bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delwin: Solaris curses vs. ncurses


From: Thomas Dickey
Subject: Re: delwin: Solaris curses vs. ncurses
Date: Sat, 28 Oct 2000 08:54:08 -0400
User-agent: Mutt/1.2.5i

On Sat, Oct 28, 2000 at 01:48:34AM -0230, Neil Zanella wrote:
> 
> 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).

well, actually I _could_, since I maintain a list for memory-leak checks.
It didn't occur to me to change the behavior of things like delwin()
when I implemented the list.
 
> 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();
> }
> 
> 
> 
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-ncurses

-- 
Thomas E. Dickey <address@hidden>
http://dickey.his.com
ftp://dickey.his.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]