Export: don't try to read past the document end
commit4eb8205f5605e680f83ce062e7d03fcf2bc26c3e
authorColomban Wendling <ban@herbesfolles.org>
Wed, 9 Apr 2014 12:44:26 +0000 (9 14:44 +0200)
committerColomban Wendling <ban@herbesfolles.org>
Wed, 9 Apr 2014 16:05:38 +0000 (9 18:05 +0200)
treeadc5349a7dc85451a1dfe2901b143ed36549db4a
parente135da8a79fa2a96d836b18159b535d0f7294ecd
Export: don't try to read past the document end

A faulty bound checking resulted in reading a byte past the document
end, which resulted in Scintilla returning byte 0 because the position
was invalid.  By adding this NUL byte to the string used to build the
body, the body was truncated after the last document byte (as C strings
are NUL-terminated), leading to any format structure after it to be
missing from the output.

This broke HTML and LaTeX export if the last line didn't end with a
newline, as the last line's style closing structure were missing.
plugins/export.c