diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2015-01-03 16:49:57 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2015-01-03 16:49:57 (GMT) |
commit | bc8e705cf90cecdff8a247264c249ffed1d2af4a (patch) | |
tree | ade014919ed664de482f4b73f846f56b52e19e13 | |
parent | a1f2872ef098cfcc526002b9c9d533da6f2775b5 (diff) | |
download | Doxygen-bc8e705cf90cecdff8a247264c249ffed1d2af4a.zip Doxygen-bc8e705cf90cecdff8a247264c249ffed1d2af4a.tar.gz Doxygen-bc8e705cf90cecdff8a247264c249ffed1d2af4a.tar.bz2 |
Correct string buffer sizes for RTF output, such that the string is always correctly sized.
-rw-r--r-- | src/rtfgen.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 0c27089..3f09eec 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -2365,17 +2365,21 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl int len; do { + lineBuf.resize(maxLineLength); 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); + lineBuf.resize(maxLineLength); while ((len=f.readLine(lineBuf.rawData(),maxLineLength))!=-1) { + lineBuf.resize(len+1); int pos; if ((pos=lineBuf.find("INCLUDETEXT"))!=-1) { @@ -2407,6 +2411,7 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl encodeForOutput(t,lineBuf); } } + lineBuf.resize(maxLineLength); } f.close(); // remove temporary file |