aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog5
-rw-r--r--composer/e-msg-composer.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index a6fde518af..e4369d88e4 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-12 Dan Winship <danw@helixcode.com>
+
+ * e-msg-composer.c (get_editor_text): NUL-terminate the data
+ extracted from the BonoboStream.
+
2000-05-10 Dan Winship <danw@helixcode.com>
* e-msg-composer-attachment-bar.c (attach_to_multipart): deal with
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;
}