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";
|
std::string res = "stream\n";
|
||||||
const char* streamData = (const char*)data(); // Force reading if not in memory
|
const char* streamData = (const char*)data(); // Force reading if not in memory
|
||||||
res += std::string(streamData, _dataLength);
|
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";
|
res += "endstream\n";
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user