fix off-by-one bug, pointed out by Michael Bell
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1827 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
82ec09e92b
commit
78d32814a1
|
@ -10,7 +10,7 @@ char *getpass(const char *prompt)
|
|||
|
||||
fputs(prompt, stderr);
|
||||
fflush(stderr);
|
||||
for (i = 0; i < sizeof(buf); i++) {
|
||||
for (i = 0; i < sizeof(buf) - 1; i++) {
|
||||
buf[i] = _getch();
|
||||
if (buf[i] == '\r')
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue