1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-01 06:27:04 +03:00

Merge pull request #282 from grooverdan/win_get_password

get_tty_password(Windows) - CreateFile error
This commit is contained in:
Georg Richter
2025-07-09 11:52:15 +02:00
committed by GitHub

View File

@ -122,11 +122,11 @@ char* get_tty_password(char *prompt, char *buffer, int length)
if (prompt)
fprintf(stderr, "%s", prompt);
if (!(Hdl= CreateFile("CONIN$",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING, 0, NULL)))
if ((Hdl= CreateFile("CONIN$",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
{
/* todo: provide a graphical dialog */
return buffer;