Hi, Bogdan,
On Mon, 22 Mar 1999, Bogdan Taru wrote:
> Hi everyone,
>
> I wanna make a shell (very simple - 4 commands only) and I want to
> avoid the old programming problem of reading a string instead of a
> character at a time (used for buffering overflow attacks). Could
If you are only worried about buffer overflow attacks, but would
otherwise like a string, you can use fgets. If you want a single
character, but would allow the user normal input editing, you can use
getc/getchar/fgetc. If you really want to do low-level terminal IO, you
will probably need one or more of the termios functions. (man termios,
or info libc low level terminal interface).
Oh, if it's a gui shell(?), there's vga_getkey().
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
> somebody point to me such a C function which reads only one character
at
> a time, without buffering the whole line before? I tried using getch()
> from ncurses library, but realized it's not very useful in my
program...
>
> Thanks & Have fun,
> bogdan
>
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]