Be sure there is a final line return when writing streams data
This commit is contained in:
parent
114ef1c5d1
commit
6be1a4707f
|
@ -106,6 +106,10 @@ namespace uPDFParser
|
|||
std::string res = "stream\n";
|
||||
const char* streamData = (const char*)data(); // Force reading if not in memory
|
||||
res += std::string(streamData, _dataLength);
|
||||
// Be sure there is a final line return
|
||||
if (streamData[_dataLength-1] != '\n' &&
|
||||
streamData[_dataLength-1] != '\r')
|
||||
res += "\n";
|
||||
res += "endstream\n";
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Reference in New Issue
Block a user