From 4575666bbe6909d6d725f43b8ee64169200856c4 Mon Sep 17 00:00:00 2001 From: Jihye Won Date: Fri, 28 Aug 2015 16:47:31 +0900 Subject: [PATCH] error: fix a bug about argument pointer variables. There was the bug after using vfprintf(). for reusing va_list arguments, va_copy should be invoked. Change-Id: I34abdbb5069ba9c18915871537883eb6cb7a5a9c Signed-off-by: Jihye Won --- tizen/src/util/error_handler.c | 1 - util/qemu-error.c | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tizen/src/util/error_handler.c b/tizen/src/util/error_handler.c index acf77604fe..027a14763e 100644 --- a/tizen/src/util/error_handler.c +++ b/tizen/src/util/error_handler.c @@ -289,7 +289,6 @@ static void report(const char *fmt, va_list ap) // We are wating for '\n' if (message[message_len - 1] == '\n') { - fprintf(stderr, "%s", message); #ifdef CONFIG_QT if (display_type == DT_MARU_QT_ONSCREEN || display_type == DT_MARU_QT_OFFSCREEN) { diff --git a/util/qemu-error.c b/util/qemu-error.c index abab065500..a767dc72d3 100644 --- a/util/qemu-error.c +++ b/util/qemu-error.c @@ -43,9 +43,14 @@ void error_vprintf(const char *fmt, va_list ap) if (cur_mon && !monitor_cur_is_qmp()) { monitor_vprintf(cur_mon, fmt, ap); } else { - vfprintf(stderr, fmt, ap); #ifdef CONFIG_MARU + va_list ap_copy; + va_copy(ap_copy, ap); + vfprintf(stderr, fmt, ap_copy); + va_end(ap_copy); report_to_clients(fmt, ap); +#else + vfprintf(stderr, fmt, ap); #endif } } -- 2.34.1