🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9364

Re: String input problems in curses

#9364
From: karl
Date: Mon, 22 Sep 1986 14:09
26 lines
1831 bytes
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
Technical Details
Message-ID: <86900065@haddock>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!ima!haddock!karl
References: <183@csustan.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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