From e48fe64e95f2cf162696a4b85580f30895ef5a0e Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Mon, 1 Jul 2002 19:11:52 +0000 Subject: [PATCH] * util_nt.c (check_error_pipe): Use "%s" in message () to prevent possible crash. (close_error_pipe): Likewise. Don't use C++ comment. --- pc/ChangeLog | 6 ++++++ pc/util_nt.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pc/ChangeLog b/pc/ChangeLog index 0f430b93f..6be3d5574 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,9 @@ +2002-07-01 Andrew V. Samoilov + + * util_nt.c (check_error_pipe): Use "%s" in message () to + prevent possible crash. + (close_error_pipe): Likewise. Don't use C++ comment. + 2002-06-04 Andrew V. Samoilov * key_nt.c (define_sequence): Adjust for declaration. diff --git a/pc/util_nt.c b/pc/util_nt.c index 0875b114c..ebd60c4a9 100644 --- a/pc/util_nt.c +++ b/pc/util_nt.c @@ -103,7 +103,7 @@ int close_error_pipe (int error, char *text) if (len == 0) return 0; /* Nothing to show */ /* Show message from pipe */ - message (error, title, msg); + message (error, title, "%s", msg); } else { /* Show given text and possible message from pipe */ message (error, title, " %s \n %s ", text, msg); @@ -120,7 +120,7 @@ void check_error_pipe (void) { int rvalue; - rvalue = -1; // read (error_pipe[0], error + len, 1); + rvalue = -1; /* read (error_pipe[0], error + len, 1); */ if (rvalue <= 0) break; len ++; @@ -129,7 +129,7 @@ void check_error_pipe (void) close (error_pipe[0]); } if (len > 0) - message (0, " Warning ", error); + message (0, " Warning ", "%s", error); } int my_system (int as_shell_command, const char *shell, const char *command)