Commit 5a47062c authored by Maks Naumov's avatar Maks Naumov Committed by Daniel Stenberg
Browse files

getpass: fix password parsing from console

Incorrect password if use backspace while entered the password.

Regression from f7bfdbab

The '?:' operator has lower priority than the '-' operator
parent 0f46b3b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */