Reading a keystroke w/o echo

Tooraj Enayati rda614j at monu6.cc.monash.edu.au
Tue May 28 15:11:44 AEST 1991


In article <24450 at lanl.gov> jlg at cochiti.lanl.gov (Jim Giles) writes:
>In article <1991May23.184302.13918 at lut.fi>, junki at lut.fi (Juha Nurmela) writes:
>|> [...]
>|> puts("Please dim Your monitor with knob called brightness.");
>|> puts("Then key Your passwd terminating with ENTER and readjust the knob");
>|> gets(password);
>|> puts("\n\n\n\n ...50 times ... \n");
>
>Sun workstations don't have a brightness control knob.
>
>J. Giles

Why not use getpass()? It's much easier.
Here is man entery for getpass. It's should be available 
under most Unix systems.
-----------------------------------------------------------------
man getpass
 
GETPASS(3-ucb)         September 27, 1988          GETPASS(3-ucb)
 
NAME
     getpass - read a password
 
SYNOPSIS
     char *getpass(prompt)
     char *prompt;
 
DESCRIPTION
     Getpass reads a password from the file /dev/tty, or, if that
     cannot be opened, from the standard input, after prompting
     with the null-terminated string prompt and    disabling
     echoing.  A pointer is returned to a null-terminated string
     of at most 8 characters.

[some stuff deleted] 
--------------------------------------------------------------------
Tooraj

-- 
Tooraj Enayati e-mail address: rda614j at monu6.cc.monash.edu.au  | One planet
         Third year of B. Computing (Digital Technology)       | one people 
    Monash University, Caulfield Campus, Melbourne, AUSTRALIA  |   why...
     



More information about the Comp.lang.c mailing list