Commit 653a2a8b authored by Dimitri van Heesch's avatar Dimitri van Heesch

Bug 728530 - Crash on \addindex \term

parent 8ba739ad
...@@ -44,6 +44,8 @@ static QCString convertIndexWordToAnchor(const QString &word) ...@@ -44,6 +44,8 @@ static QCString convertIndexWordToAnchor(const QString &word)
QCString result; QCString result;
const char *str = word.data(); const char *str = word.data();
unsigned char c; unsigned char c;
if (str)
{
while ((c = *str++)) while ((c = *str++))
{ {
if ((c >= 'a' && c <= 'z') || // ALPHA if ((c >= 'a' && c <= 'z') || // ALPHA
...@@ -67,6 +69,7 @@ static QCString convertIndexWordToAnchor(const QString &word) ...@@ -67,6 +69,7 @@ static QCString convertIndexWordToAnchor(const QString &word)
result += enc; result += enc;
} }
} }
}
return result; return result;
} }
......
...@@ -38,6 +38,8 @@ static QCString escapeLabelName(const char *s) ...@@ -38,6 +38,8 @@ static QCString escapeLabelName(const char *s)
QCString result; QCString result;
const char *p=s; const char *p=s;
char c; char c;
if (p)
{
while ((c=*p++)) while ((c=*p++))
{ {
switch (c) switch (c)
...@@ -51,6 +53,7 @@ static QCString escapeLabelName(const char *s) ...@@ -51,6 +53,7 @@ static QCString escapeLabelName(const char *s)
default: result+=c; default: result+=c;
} }
} }
}
return result; return result;
} }
...@@ -73,6 +76,8 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s) ...@@ -73,6 +76,8 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s)
const char *p=s; const char *p=s;
char str[2]; str[1]=0; char str[2]; str[1]=0;
char c; char c;
if (p)
{
while ((c=*p++)) while ((c=*p++))
{ {
switch (c) switch (c)
...@@ -88,6 +93,7 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s) ...@@ -88,6 +93,7 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s)
default: str[0]=c; filter(str); break; default: str[0]=c; filter(str); break;
} }
} }
}
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment