summaryrefslogtreecommitdiffstats
path: root/tdemarkdown
diff options
context:
space:
mode:
Diffstat (limited to 'tdemarkdown')
-rw-r--r--tdemarkdown/markdown_part.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tdemarkdown/markdown_part.cpp b/tdemarkdown/markdown_part.cpp
index 604873fc3..7ea3d99b1 100644
--- a/tdemarkdown/markdown_part.cpp
+++ b/tdemarkdown/markdown_part.cpp
@@ -73,6 +73,11 @@ bool MarkdownPart::openURL(const KURL& u)
if(!data.isNull())
{
+ if (data[data.size()-1] != '\0')
+ {
+ data.resize(data.size()+1);
+ data[data.size()-1] = '\0';
+ }
begin(u);
TQString parsed(parse((MD_CHAR*) data.data()));
write(parsed);
@@ -109,6 +114,11 @@ TQString& MarkdownPart::parse(MD_CHAR* document)
}
else
{
+ if (data[data.size()-1] != '\0')
+ {
+ data.resize(data.size()+1);
+ data[data.size()-1] = '\0';
+ }
m_buffer += TQString::fromLocal8Bit(data);
}