Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>getlongpass</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
getlongpass
===========

Syntax
------

     #include <stdlib.h>
     
     int  getlongpass(const char *prompt, char *password, int max_length)

Description
-----------

This function reads up to a Newline (CR or LF) or EOF (Ctrl-D or Ctrl-Z)
from the standard input, without an echo, after prompting with a
null-terminated string PROMPT.  It puts a null-terminated string of at
most MAX_LENGTH - 1 first characters typed by the user into a buffer
pointed to by PASSWORD.  Pressing Ctrl-C or Ctrl-Break will cause the
calling program to `exit(1)'.

Return Value
------------

Zero if successfull, -1 on error (and ERRNO is set to and appropriate
value.

Example
-------

     char password[MAX_PASS];
     
     (void)getlongpass("Password: ", password, MAX_PASS);


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson