summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaks Naumov <maksqwe1@ukr.net>2014-01-27 16:52:42 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-01-28 13:28:00 +0100
commit5a47062cada9bff545f1b611c7b4c9f7b1ade0cf (patch)
tree1f3e0893ab8032b5095c6b2d1e75c3a1e750b34e /src
parent0f46b3b3ddcf4fe0546477a1f09287ad358bb31e (diff)
downloadcurl-5a47062cada9bff545f1b611c7b4c9f7b1ade0cf.tar.gz
getpass: fix password parsing from console
Incorrect password if use backspace while entered the password. Regression from f7bfdbabf2d5398f4c266eabb0992a04af661f22 The '?:' operator has lower priority than the '-' operator
Diffstat (limited to 'src')
-rw-r--r--src/tool_getpass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tool_getpass.c b/src/tool_getpass.c
index 0ac7dcbe0..4c8dcb9f1 100644
--- a/src/tool_getpass.c
+++ b/src/tool_getpass.c
@@ -117,7 +117,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
if(buffer[i] == '\b')
/* remove this letter and if this is not the first key, remove the
previous one as well */
- i = i - (i >= 1) ? 2 : 1;
+ i = i - (i >= 1 ? 2 : 1);
}
#ifndef __SYMBIAN32__
/* since echo is disabled, print a newline */