1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-07-30 19:03:17 +03:00

get_tty_password(Windows) - CreateFile error

The Windows error condition for failing to open a file is
INVALID_HANDLE_VALUE is returned.
This commit is contained in:
Daniel Black
2025-05-29 16:39:50 +10:00
parent 163fc458a2
commit d226315ef8

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;