aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-05-13 02:20:47 +0800
committerDan Winship <danw@src.gnome.org>2000-05-13 02:20:47 +0800
commit0e5f158b527845a980eec37d12f23f035bc2f22f (patch)
tree29f1215ed8f8f8b33d3f5c3eb328530051dd4239 /composer/e-msg-composer.c
parent46c9e469480b53cba7726036a931eeea1af37383 (diff)
downloadgsoc2013-evolution-0e5f158b527845a980eec37d12f23f035bc2f22f.tar.gz
gsoc2013-evolution-0e5f158b527845a980eec37d12f23f035bc2f22f.tar.zst
gsoc2013-evolution-0e5f158b527845a980eec37d12f23f035bc2f22f.zip
NUL-terminate the data extracted from the BonoboStream.
* e-msg-composer.c (get_editor_text): NUL-terminate the data extracted from the BonoboStream. svn path=/trunk/; revision=3005
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index c575a3b800..eab6dfca92 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -107,6 +107,7 @@ get_editor_text (BonoboWidget *editor)
{
Bonobo_PersistStream persist;
BonoboStream *stream;
+ BonoboStreamMem *stream_mem;
CORBA_Environment ev;
char *text;
@@ -130,7 +131,10 @@ get_editor_text (BonoboWidget *editor)
Bonobo_Unknown_unref (persist, &ev);
CORBA_exception_free (&ev);
- text = g_strdup (bonobo_stream_mem_get_buffer (BONOBO_STREAM_MEM (stream)));
+ stream_mem = BONOBO_STREAM_MEM (stream);
+ text = g_malloc (stream_mem->pos + 1);
+ memcpy (text, stream_mem->buffer, stream_mem->pos);
+ text[stream_mem->pos] = 0;
bonobo_object_unref (BONOBO_OBJECT(stream));
return text;
}