diff options
author | Dan Winship <danw@src.gnome.org> | 2000-05-13 02:20:47 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-05-13 02:20:47 +0800 |
commit | 0e5f158b527845a980eec37d12f23f035bc2f22f (patch) | |
tree | 29f1215ed8f8f8b33d3f5c3eb328530051dd4239 | |
parent | 46c9e469480b53cba7726036a931eeea1af37383 (diff) | |
download | gsoc2013-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
-rw-r--r-- | composer/ChangeLog | 5 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 6 |
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; } |