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

This commit is contained in:
Tobias Brunner
2014-07-02 12:38:44 +02:00
parent 32a262e7a1
commit 0a26f39a71
+2
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');