]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Consistency in error messages
authorDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Thu, 30 Dec 2021 21:57:26 +0000 (22:57 +0100)
committerDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Sat, 26 Feb 2022 15:43:16 +0000 (16:43 +0100)
- 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

diff --git a/main.c b/main.c
index 65be6a2f1e1d791567dfddde9cf1de7c1feb2ca4..f0b89daeb90047c53caca77f31768bf503be6c38 100644 (file)
--- 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;