www.delorie.com/djgpp/doc/libc/libc_404.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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 successful, -1 on error (and errno is set to an appropriate value).

Portability

ANSI/ISO C No
POSIX No

Example

 
char password[MAX_PASS];

(void)getlongpass("Password: ", password, MAX_PASS);


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004