summaryrefslogtreecommitdiffstats
path: root/src/template.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-04-26 17:32:20 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-04-26 17:32:20 (GMT)
commit55e86052e0522ac7b51743449055572cc8bc7823 (patch)
tree7f69870aea5296850947967e567706538082dae5 /src/template.cpp
parent51316839084c3292a8fb216e73ed146683028d4a (diff)
downloadDoxygen-55e86052e0522ac7b51743449055572cc8bc7823.zip
Doxygen-55e86052e0522ac7b51743449055572cc8bc7823.tar.gz
Doxygen-55e86052e0522ac7b51743449055572cc8bc7823.tar.bz2
Fix issues caused by QCString::rawData and QCString::operator[]
- methods were marked const but still returned a non-const reference, cause wrongly optimized code for some platforms/compilers
Diffstat (limited to 'src/template.cpp')
-rwxr-xr-xsrc/template.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/template.cpp b/src/template.cpp
index 9ae2c11..82b35f7 100755
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -2356,7 +2356,7 @@ QCString TemplateContextImpl::recode(const QCString &s)
QCString output(oSize);
size_t iLeft = iSize;
size_t oLeft = oSize;
- char *iPtr = s.rawData();
+ const char *iPtr = s.data();
char *oPtr = output.rawData();
if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
{
@@ -3557,6 +3557,7 @@ static void stripLeadingWhiteSpace(QCString &s)
else { *dst++=c; skipSpaces=FALSE; }
}
*dst='\0';
+ s.resize( (int)(dst - src) + 1 );
}
}