qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PATCH] qemu-char: Fix compiler warning (-Wuninitialized)


From: Stefan Weil
Subject: [Qemu-trivial] [PATCH] qemu-char: Fix compiler warning (-Wuninitialized)
Date: Wed, 25 Jun 2014 20:54:53 +0200

qemu-char.c:155:8: warning:
 'res' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Stefan Weil <address@hidden>
---
 qemu-char.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-char.c b/qemu-char.c
index c1ea84c..c65f81f 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -133,7 +133,7 @@ int qemu_chr_fe_write(CharDriverState *s, const uint8_t 
*buf, int len)
 int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len)
 {
     int offset = 0;
-    int res;
+    int res = 0;
 
     qemu_mutex_lock(&s->chr_write_lock);
     while (offset < len) {
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]