Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!think!ima!haddock!karl From: karl@haddock Newsgroups: net.lang.c Subject: Re: String input problems in curses Message-ID: <86900065@haddock> Date: Mon, 22-Sep-86 10:09:00 EDT Article-I.D.: haddock.86900065 Posted: Mon Sep 22 10:09:00 1986 Date-Received: Mon, 22-Sep-86 21:38:30 EDT References: <183@csustan.UUCP> Lines: 26 Nf-ID: #R:csustan.UUCP:183:haddock:86900065:000:1286 Nf-From: haddock!karl Sep 22 10:09:00 1986 csustan!guest (Chris Rhodes) writes: >while designing a particular application using curses, the UNIX >terminal control package, I have found that *none* of the string >input functions work - not gets, scanf, or wscanw or any of the >other curses input routines. >I ended up having to do a "while ( (c = getchar()) != '\n');" >structure which works, but I fear that I may be doing something >wrong which may cause other mysterious bugs. I don't know if it's the same on 4.2bsd, but in SysV curses it isn't really safe to use stdio directly -- you should use the curses getch() function instead of getchar(). But you say wscanw() etc. are also failing? Assuming it isn't a curses bug (if so, you'd think someone else would have found it by now -- it looks pretty serious!), I'd guess that you've used an identifier that accidentally collides with a global identifier from the library. (I had a similar problem with a program that had a global variable named "time".) Try using lint, if you have a decent lint library for curses. >Most of these give me a "Bus error (core dumped)" message (one which I have >generally gotten sick of) Have you considered examining the core dump? That's what it's for! Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint