mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-22 11:21:28 +00:00
Misread the docs, readpassphrase() will in fact set errno.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@39105 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6c7e7055b9
commit
4ca4d42c6f
1 changed files with 2 additions and 7 deletions
13
EcConsole.m
13
EcConsole.m
|
@ -1076,19 +1076,14 @@ consoleCompleter(const char *text, int start, int end)
|
||||||
/* read password (glibc documentation says not to use getpass?) */
|
/* read password (glibc documentation says not to use getpass?) */
|
||||||
|
|
||||||
line = getpass("Password: ");
|
line = getpass("Password: ");
|
||||||
if (0 == line)
|
#else
|
||||||
|
line = readpassphrase("Password: ", &buf[0], 128, RPP_ECHO_OFF);
|
||||||
|
#endif
|
||||||
|
if (NULL == line)
|
||||||
{
|
{
|
||||||
NSLog(@"Could not read password: %s", strerror(errno));
|
NSLog(@"Could not read password: %s", strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
line = readpassphrase("Password: ", &buf[0], 128, RPP_ECHO_OFF);
|
|
||||||
if (NULL == line)
|
|
||||||
{
|
|
||||||
NSLog(@"Could not read password");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
p = [[NSString stringWithCString: line] stringByTrimmingSpaces];
|
p = [[NSString stringWithCString: line] stringByTrimmingSpaces];
|
||||||
if ([p caseInsensitiveCompare: @"quit"] == NSOrderedSame)
|
if ([p caseInsensitiveCompare: @"quit"] == NSOrderedSame)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue