bug-ncurses
[Top][All Lists]
Advanced

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

Re: newwin seg fault


From: Thomas Dickey
Subject: Re: newwin seg fault
Date: Thu, 14 Mar 2002 19:45:20 -0500
User-agent: Mutt/1.2.5i

On Thu, Mar 14, 2002 at 07:40:15PM -0500, Joe Davies wrote:
> Hello Thomas,
> 
> My understanding was that it returned a window which filled to the right of
> the screen.  I *think* I've figured it out: in one of my following routines,
> I must have a call to a function that tries to print to a line outside of
> the bounds of the main window.  ie printing to (17,1) where the window is
> only defined to (14,1).

ok (I should reread the manpage too ;-)

       Calling newwin creates and returns a pointer to a new win-
       dow with the given number of lines and columns.  The upper
       left-hand  corner of the window is at line begin_y, column
       begin_x.  If either nlines or ncols is zero, they  default
       to  LINES - begin_y and COLS - begin_x.  A new full-screen
       window is created by calling newwin(0,0,0,0).

some of the out-of-bounds stuff is caught by limit checks, though.
>From your description I can't tell if this is an overlooked case,
or your program's bug.
 
> Stupid thing now that I think about it...
> 
> Thanks for your help!
> Joe
> 
> -----Original Message-----
> From: Thomas Dickey [mailto:address@hidden
> Sent: Thursday, March 14, 2002 7:26 PM
> To: Joe Davies
> Cc: address@hidden
> Subject: Re: newwin seg fault
> 
> 
> On Thu, Mar 14, 2002 at 06:54:37PM -0500, Joe Davies wrote:
> > Hello All,
> >
> > This is my first post to this list.  I'm developing a simple app on unix
> > sysV, using Curses (I know, not nCurses!) and can't find any decent
> > resources or help on curses.  I ordered a book on Feb 25th, but it hasn't
> > arrived yet!
> >
> > Anyway, when I create a window using newwin(0,0,0,0) I have no problems,
> but
> > when I try to define some constraints to the window, I get a segfault on
> > run.  This is using: newwin(14,0,0,0)
> 
> That's a window which has zero columns.  Doesn't newwin return a null
> pointer
> in that case?
> 
>        WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x);
> 
> --
> Thomas E. Dickey <address@hidden>
> http://invisible-island.net
> ftp://invisible-island.net

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net



reply via email to

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