windows: Make sure the string returned from ReadConsole() is null terminated
This commit is contained in:
@@ -291,6 +291,8 @@ char* getpass(const char *prompt)
|
|||||||
SetConsoleMode(in, mode);
|
SetConsoleMode(in, mode);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
buf[sizeof(buf)-1] = '\0';
|
||||||
|
|
||||||
if (done)
|
if (done)
|
||||||
{
|
{
|
||||||
pos = strchr(buf, '\r');
|
pos = strchr(buf, '\r');
|
||||||
|
|||||||
Reference in New Issue
Block a user