"Nitin" <nitin_manohar _at_ yahoo.com> writes:
You have probably got follows from other newsgroups ...
>Hi,
> I'm using menu library of ncurses library for development of a tool. While
> executing a
> program segmentation fault is coming, and core dumped. After several checks
> I'm not able to find the bug. I'm running on RedHat Linux 6.2 and SuSE
> Linux.
I've never used (n)curses, but I think new_menu counts the number of
items from it's argument array, and the array must be terminated with
NULL.
> ITEM * myitem[2];
ITEM * myitem[3];
> MENU * menu[1];
>
> if((myitem[0] = new_item("Menu", "love")) == NULL ){
> printf("\n Error on new item");
> exit(1);
> }
>
> if((myitem[1] = new_item("Menu-2nd", "love")) == NULL ){
> printf("\n Error on 2nd new item");
> exit(1);
> }
myitem[2] = NULL;
> initscr(); /* Initilise the Curses*/
>
> menu[0] = new_menu(myitem); / * Here segmentation fault is coming......core
> dumped*/
---------------------------------------------------------------------
tesigana _at_ mtf.biglobe.ne.jp
References:
- Prev by Date: [fol] ,L.E-G,A.L; ,C.A-B`L`E, .B-O`X` ;D`E`S,C;R,A.MB;L,E.R- S,E.E; A-L`L` `T`H`E` `CH-A;NN.EL,S;,;,;;,,;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4476
- Next by Date: [fol] vmware のインストール
- Previous by thread: [fol] "ncurses"--help needed......
- Next by thread: [fol] Re: "ncurses"--help needed......
- Indexes:[Main][Thread]