summaryrefslogtreecommitdiffstats
path: root/src/latexdocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-04-19 14:27:11 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-04-19 14:27:11 (GMT)
commit653a2a8b123b79835af9f684f8b92ef7f88712aa (patch)
tree548f3cface232e706f202ab718ce01ca2f387b57 /src/latexdocvisitor.cpp
parent8ba739ad1ecde1036bfe2e364aee378e137f6dff (diff)
downloadDoxygen-653a2a8b123b79835af9f684f8b92ef7f88712aa.zip
Doxygen-653a2a8b123b79835af9f684f8b92ef7f88712aa.tar.gz
Doxygen-653a2a8b123b79835af9f684f8b92ef7f88712aa.tar.bz2
Bug 728530 - Crash on \addindex \term
Diffstat (limited to 'src/latexdocvisitor.cpp')
-rw-r--r--src/latexdocvisitor.cpp46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 68f0f06..eed36bc 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -38,17 +38,20 @@ static QCString escapeLabelName(const char *s)
QCString result;
const char *p=s;
char c;
- while ((c=*p++))
+ if (p)
{
- switch (c)
+ while ((c=*p++))
{
- case '%': result+="\\%"; break;
- case '|': result+="\\texttt{\"|}"; break;
- case '!': result+="\"!"; break;
- case '{': result+="\\lcurly{}"; break;
- case '}': result+="\\rcurly{}"; break;
- case '~': result+="````~"; break; // to get it a bit better in index together with other special characters
- default: result+=c;
+ switch (c)
+ {
+ case '%': result+="\\%"; break;
+ case '|': result+="\\texttt{\"|}"; break;
+ case '!': result+="\"!"; break;
+ case '{': result+="\\lcurly{}"; break;
+ case '}': result+="\\rcurly{}"; break;
+ case '~': result+="````~"; break; // to get it a bit better in index together with other special characters
+ default: result+=c;
+ }
}
}
return result;
@@ -73,19 +76,22 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s)
const char *p=s;
char str[2]; str[1]=0;
char c;
- while ((c=*p++))
+ if (p)
{
- switch (c)
+ while ((c=*p++))
{
- case '!': m_t << "\"!"; break;
- case '"': m_t << "\"\""; break;
- case '@': m_t << "\"@"; break;
- case '|': m_t << "\\texttt{\"|}"; break;
- case '[': m_t << "["; break;
- case ']': m_t << "]"; break;
- case '{': m_t << "\\lcurly{}"; break;
- case '}': m_t << "\\rcurly{}"; break;
- default: str[0]=c; filter(str); break;
+ switch (c)
+ {
+ case '!': m_t << "\"!"; break;
+ case '"': m_t << "\"\""; break;
+ case '@': m_t << "\"@"; break;
+ case '|': m_t << "\\texttt{\"|}"; break;
+ case '[': m_t << "["; break;
+ case ']': m_t << "]"; break;
+ case '{': m_t << "\\lcurly{}"; break;
+ case '}': m_t << "\\rcurly{}"; break;
+ default: str[0]=c; filter(str); break;
+ }
}
}
return result;