From: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Date: Thu, 30 Dec 2021 21:57:26 +0000 (+0100) Subject: Consistency in error messages X-Git-Tag: v9.00~45^2^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a62ce567cb7cc11a03aaa94f41f433b1b2bb3f16;p=users%2Fdwmw2%2Fopenconnect.git 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> --- 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;