vnc/vnc.c: fixed `-Wmaybe-uninitialized` warnings

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;
      |         ^
This commit is contained in:
firewave 2023-10-17 15:29:01 +02:00
parent fb9c175b11
commit 5db94568ec
1 changed files with 3 additions and 3 deletions

View File

@ -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;