From a5c6130c7a82f4efa849eb1f731aa87dad87bb5f Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 6 Oct 2020 14:32:14 +0200 Subject: [PATCH] waveshare: fix 'may be used uninitialized' warning --- client/src/cmdhfwaveshare.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdhfwaveshare.c b/client/src/cmdhfwaveshare.c index 224fe9757..3cc2bf99f 100644 --- a/client/src/cmdhfwaveshare.c +++ b/client/src/cmdhfwaveshare.c @@ -231,7 +231,7 @@ static void dither_rgb_inplace(int16_t *chanR, int16_t *chanG, int16_t *chanB, u int16_t oldR = chanR[XX + Y * width]; int16_t oldG = chanG[XX + Y * width]; int16_t oldB = chanB[XX + Y * width]; - uint8_t newR, newG, newB; + uint8_t newR = 0, newG = 0, newB = 0; nearest_color(oldR, oldG, oldB, palette, palettelen, &newR, &newG, &newB); chanR[XX + Y * width] = newR; chanG[XX + Y * width] = newG;