mirror of
https://github.com/curl/curl.git
synced 2026-08-02 16:00:28 +03:00
getpass: fix password parsing from console
Incorrect password if use backspace while entered the password.
Regression from f7bfdbabf2
The '?:' operator has lower priority than the '-' operator
This commit is contained in:
parent
0f46b3b3dd
commit
5a47062cad
1 changed files with 1 additions and 1 deletions
|
|
@ -117,7 +117,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||||
if(buffer[i] == '\b')
|
if(buffer[i] == '\b')
|
||||||
/* remove this letter and if this is not the first key, remove the
|
/* remove this letter and if this is not the first key, remove the
|
||||||
previous one as well */
|
previous one as well */
|
||||||
i = i - (i >= 1) ? 2 : 1;
|
i = i - (i >= 1 ? 2 : 1);
|
||||||
}
|
}
|
||||||
#ifndef __SYMBIAN32__
|
#ifndef __SYMBIAN32__
|
||||||
/* since echo is disabled, print a newline */
|
/* since echo is disabled, print a newline */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue