From: Viktor Szakats Date: Tue, 26 Nov 2024 12:03:49 +0000 (+0100) Subject: tool_getpass: replace `getch()` call with `_getch()` on Windows X-Git-Tag: curl-8_11_1~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7660a280932ba4a3b96f0195143d8891633cada5;p=thirdparty%2Fcurl.git 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 72edb22b8a0e1e62216b59a045147d1a863ad59b #15638 Closes #15642 --- diff --git a/src/tool_getpass.c b/src/tool_getpass.c index 412c50a114..91dfb4638a 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -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;