From: Blue Swirl Date: Tue, 27 Jul 2010 15:34:10 +0000 (+0000) Subject: Initialize a variable in all cases X-Git-Tag: xen-15-06-02~7194 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d167f9bc06a577d6c85b8ed6991c1efe175aae7d;p=people%2Fsstabellini%2Fqemu-dm.git%2F.git Initialize a variable in all cases Fix a warning with some GCCs: /src/qemu/ui/vnc-enc-tight.c: In function `send_sub_rect_nojpeg': /src/qemu/ui/vnc-enc-tight.c:1458: warning: `ret' might be used uninitialized in this function Signed-off-by: Blue Swirl --- diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 71f3fa3d39..4a6aca2d57 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -1469,6 +1469,8 @@ static int send_sub_rect_nojpeg(VncState *vs, int x, int y, int w, int h, ret = send_mono_rect(vs, x, y, w, h, bg, fg); } else if (colors <= 256) { ret = send_palette_rect(vs, x, y, w, h, palette); + } else { + ret = 0; } return ret; }