From a62ce567cb7cc11a03aaa94f41f433b1b2bb3f16 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Date: Thu, 30 Dec 2021 22:57:26 +0100 Subject: [PATCH] Consistency in error messages - When ReadConsoleW() fails, the error message refers to the generic ReadConsole() function, not its A or W version. Use the same rule for CommandLineToArgW(). - Use similar error messages for fgets() and fgetws(). Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 65be6a2f..f0b89dae 100644 --- a/main.c +++ b/main.c @@ -383,7 +383,7 @@ static char *convert_arg_to_utf8(char **argv, char *arg) argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); if (!argv_w) { char *errstr = openconnect__win32_strerror(GetLastError()); - fprintf(stderr, _("CommandLineToArgvW() failed: %s\n"), + fprintf(stderr, _("CommandLineToArgv() failed: %s\n"), errstr); free(errstr); exit(1); @@ -464,7 +464,7 @@ static void read_stdin(char **string, int hidden, int allow_fail) /* Not a console; maybe reading from a piped stdin? */ if (!fgetws(wbuf, ARRAY_SIZE(wbuf), stdin)) { char *errstr = openconnect__win32_strerror(GetLastError()); - fprintf(stderr, _("fgetws() failed: %s\n"), errstr); + fprintf(stderr, _("fgetws (stdin): %s\n"), errstr); free(errstr); *string = NULL; return; -- 2.50.1