windows: Make sure the string returned from ReadConsole() is null terminated
This commit is contained in:
parent
32a262e7a1
commit
0a26f39a71
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue