tool_getpass: replace getch() call with _getch() on Windows

`getch()` is deprecated according to MSDN:
https://learn.microsoft.com/cpp/c-runtime-library/reference/getch
"The Microsoft-specific function name `getch` is a deprecated alias
for the `_getch` function."

Ref: https://learn.microsoft.com/cpp/c-runtime-library/reference/getch-getwch

Follow-up to 72edb22b8a #15638
Closes #15642
This commit is contained in:
Viktor Szakats 2024-11-26 13:03:49 +01:00
parent 4341df5040
commit 7660a28093
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -102,7 +102,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
fputs(prompt, tool_stderr);
for(i = 0; i < buflen; i++) {
buffer[i] = (char)getch();
buffer[i] = (char)_getch();
if(buffer[i] == '\r' || buffer[i] == '\n') {
buffer[i] = '\0';
break;