diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-04-19 14:27:11 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-04-19 14:27:11 (GMT) |
commit | 653a2a8b123b79835af9f684f8b92ef7f88712aa (patch) | |
tree | 548f3cface232e706f202ab718ce01ca2f387b57 /src/latexdocvisitor.cpp | |
parent | 8ba739ad1ecde1036bfe2e364aee378e137f6dff (diff) | |
download | Doxygen-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.cpp | 46 |
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; |