summaryrefslogtreecommitdiffstats
path: root/src/rtfgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r--src/rtfgen.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 354469b..2a6fd07 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -2362,19 +2362,22 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl
// this is EXTREEEEEEEMLY brittle. It works on OUR rtf
// files because the first line before the body
// ALWAYS contains "{\comment begin body}"
+ int len;
do
{
- if (f.readLine(lineBuf.data(),maxLineLength)==-1)
+ if ((len=f.readLine(lineBuf.rawData(),maxLineLength))==-1)
{
err("read error in %s before end of RTF header!\n",infName.data());
return FALSE;
}
+ lineBuf.resize(len+1);
if (bIncludeHeader) encodeForOutput(t,lineBuf.data());
} while (lineBuf.find("\\comment begin body")==-1);
- while (f.readLine(lineBuf.data(),maxLineLength)!=-1)
+ while ((len=f.readLine(lineBuf.rawData(),maxLineLength))!=-1)
{
+ lineBuf.resize(len+1);
int pos;
if ((pos=lineBuf.find("INCLUDETEXT"))!=-1)
{