From 5db94568ec09bea759296f212c49fc822bd770f4 Mon Sep 17 00:00:00 2001 From: firewave Date: Tue, 17 Oct 2023 15:29:01 +0200 Subject: [PATCH] vnc/vnc.c: fixed `-Wmaybe-uninitialized` warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vnc.c: In function ‘lib_framebuffer_update’: vnc.c:816:37: error: ‘b’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 816 | return (r << 16) | (g << 8) | b; | ~~~~~~~~~~~~~~~~~~~~~^~~ vnc.c:1301:9: note: ‘b’ was declared here 1301 | int b; | ^ vnc.c:816:31: error: ‘g’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 816 | return (r << 16) | (g << 8) | b; | ~~~^~~~~ vnc.c:1300:9: note: ‘g’ was declared here 1300 | int g; | ^ vnc.c:816:19: error: ‘r’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 816 | return (r << 16) | (g << 8) | b; | ~~~^~~~~~ vnc.c:1299:9: note: ‘r’ was declared here 1299 | int r; | ^ --- vnc/vnc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnc/vnc.c b/vnc/vnc.c index 97f53bf4..09de00d2 100644 --- a/vnc/vnc.c +++ b/vnc/vnc.c @@ -1249,9 +1249,9 @@ lib_framebuffer_update(struct vnc *v) int srcy; unsigned int encoding; int pixel; - int r; - int g; - int b; + int r = 0; + int g = 0; + int b = 0; int error; int need_size; struct stream *s;