error: fix a bug about argument pointer variables.
authorJihye Won <jihye.won1@samsung.com>
Fri, 28 Aug 2015 07:47:31 +0000 (16:47 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 31 Aug 2015 02:48:26 +0000 (11:48 +0900)
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 <jihye.won1@samsung.com>
tizen/src/util/error_handler.c
util/qemu-error.c

index acf77604fe18af48c8e46e38b64f052e6898b396..027a14763e8fcc84a2407ba5936e06812f4dd7f8 100644 (file)
@@ -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) {
index abab065500a63332e5955c67cd2f224ce2be51ba..a767dc72d3fbd8813bb9052cdc3735550ad9f186 100644 (file)
@@ -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
     }
 }