From 972d85610a78e245a1b4458be1dd2bba127cfd1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Wed, 19 Jun 2019 21:10:56 +0200 Subject: [PATCH] wcolorpanel.c Avoid compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch removes this warning. The patch adds a switch case that never should happend. wcolorpanel.c: In function ‘rgbInit’: wcolorpanel.c:3403:2: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized] sprintf(tmp, format, panel->color.rgb.green); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Rodolfo García Peñas (kix) --- WINGs/wcolorpanel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index 2cd18065..5fced18a 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -3396,6 +3396,9 @@ static void rgbInit(W_ColorPanel * panel) case RGBhex: format = "%0X"; break; + default: + /* Avoid compiler warning */ + format = ""; } sprintf(tmp, format, panel->color.rgb.red);