www.delorie.com/djgpp/doc/libc-2.01/libc_336.html   search  
Go to the first, previous, next, last section, table of contents.


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);


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997