summaryrefslogtreecommitdiffstats
path: root/src/xmlgen.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-09-12 16:41:33 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-09-12 16:41:33 (GMT)
commit0a4b995cdd7735aaf42c423eed2889db5b8617ef (patch)
treeeccba7d2c0df00308839ad73cfc06d3afee4c5fd /src/xmlgen.cpp
parentaca45fd514cadc56ac277bd54f49604708ebbb5d (diff)
downloadDoxygen-0a4b995cdd7735aaf42c423eed2889db5b8617ef.zip
Doxygen-0a4b995cdd7735aaf42c423eed2889db5b8617ef.tar.gz
Doxygen-0a4b995cdd7735aaf42c423eed2889db5b8617ef.tar.bz2
Fixing problem with possible not initialized variable (endless loop in VS 2017 debug)
The not initialized variable `l` caused and endless loop in the VS2017 debug version, variable should not have been used.
Diffstat (limited to 'src/xmlgen.cpp')
-rw-r--r--src/xmlgen.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index e68c454..be866a2 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -1845,7 +1845,7 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
SDict<SectionInfo>::Iterator li(*sectionDict);
SectionInfo *si;
int level=1,l;
- bool inLi[5]={ FALSE, FALSE, FALSE, FALSE };
+ bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE };
int maxLevel = pd->localToc().xmlLevel();
for (li.toFirst();(si=li.current());++li)
{
@@ -1872,16 +1872,16 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
if (l <= maxLevel) t << " </tableofcontents>" << endl;
}
}
- if (l <= maxLevel && inLi[nextLevel]) t << " </tocsect>" << endl;
if (nextLevel <= maxLevel)
{
+ if (inLi[nextLevel]) t << " </tocsect>" << endl;
QCString titleDoc = convertToXML(si->title);
t << " <tocsect>" << endl;
t << " <name>" << (si->title.isEmpty()?si->label:titleDoc) << "</name>" << endl;
t << " <reference>" << convertToXML(pageName) << "_1" << convertToXML(si -> label) << "</reference>" << endl;
+ inLi[nextLevel]=TRUE;
+ level = nextLevel;
}
- inLi[nextLevel]=TRUE;
- level = nextLevel;
}
}
while (level>1 && level <= maxLevel)