2 Copyright © 2017, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
13 #include "__posixc_intbase.h"
15 /*****************************************************************************
26 (obsolete) prompt for a password.
33 This function returns a pointer to a static buffer
34 containing (the first PASS_MAX bytes of) the password without the
35 trailing newline, terminated by a null byte ('\0').
37 The buffer may be overwritten by a subsequent call
47 ******************************************************************************/
49 struct PosixCBase
*PosixCBase
= __aros_getbase_PosixCBase();
50 struct PosixCIntBase
*PosixCIntBase
= (struct PosixCIntBase
*)PosixCBase
;
53 /* quick and ugly... */
55 ((fputs(prompt
, PosixCBase
->_stdout
) != EOF
) &&
56 (fputs("\n", PosixCBase
->_stdout
) != EOF
)))
58 fflush(PosixCBase
->_stdout
);
60 s
= fgets(PosixCIntBase
->passbuffer
, PASS_MAX
, PosixCBase
->_stdin
);
63 /* strip trailing \n */
64 size_t sl
= strlen(s
);
65 if ( (sl
> 0) && (s
[sl
-1] == '\n') )