windows: Make sure the string returned from ReadConsole() is null terminated

This commit is contained in:
Tobias Brunner 2014-07-02 11:49:34 +02:00
parent 32a262e7a1
commit 0a26f39a71
1 changed files with 2 additions and 0 deletions

View File

@ -291,6 +291,8 @@ char* getpass(const char *prompt)
SetConsoleMode(in, mode);
return NULL;
}
buf[sizeof(buf)-1] = '\0';
if (done)
{
pos = strchr(buf, '\r');