[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9519.0. "cbreak causes memory fault in unix v3.2*" by RHETT::LOH () Wed Apr 16 1997 10:26

    
    Hi,
    
    The following program works on Digital unix v4.0*, but got a memory
    fault on v3.2*.  If I commented out the cbreak() statement, 
    the program runs fine.  Is this a known bug with cbreak()
    in unix v3.2*?
    
    Thanks,
    Lannie
    
    =====
    
    #include <stdio.h>
    #include <curses.h>
                                                             
    main()
    {
            int c, j;
                    
            j = cbreak();
    
            while ((c = getchar()) != EOF) {
                    putchar(c);
            }
    }
    
    
    
    
T.RTitleUserPersonal
Name
DateLines
9519.1initscr()KAMPUS::NEIDECKEREUROMEDIA: Distributed Multimedia ArchivesThu Apr 17 1997 06:083
    The "curses" man page states that you should use "initscr()" before
    using any curses function. Calling initscr before cbreak makes
    the fault on 3.2 go away. Don't know why it seems to work on 4.0.
9519.2RHETT::LOHThu Apr 17 1997 12:077
    
    Re: .1
    
    Thanks for the reply.  Is this a bug in v4.0x?
    
    Thanks,
    Lannie