From 60f308826d0a3e6542007425dd40a85c20070152 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Fri, 4 Oct 2024 20:18:46 +0100 Subject: [PATCH] grDStyle.c: GrLoadStyles() scount, The left operand of '<' is a garbage value The use of 'scount' in this function looks complex, it seems to be reset to zero sometimes and incremented at others. Analysis shows there is a possible path where is maybe used uninitialized. Setting to zero seems like a good choice. SonarCloud grDStyle.c:514 The left operand of '<' is a garbage value https://sonarcloud.io/project/issues?open=AZJB16zUNGfDNup0RiqE&id=dlmiles_magic --- graphics/grDStyle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/grDStyle.c b/graphics/grDStyle.c index d85c15e4..aa9275ce 100644 --- a/graphics/grDStyle.c +++ b/graphics/grDStyle.c @@ -408,7 +408,7 @@ char *libPath; { FILE *inp; int res = 0; - int i, scount, processed = DISP_VERSION; + int i, scount = 0, processed = DISP_VERSION; char fullName[256]; dstylelink *sstyle; int MaxTechStyles = 0, MaxTileStyles = 0;