aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/itip-control-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/itip-control-factory.c')
-rw-r--r--calendar/gui/itip-control-factory.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/calendar/gui/itip-control-factory.c b/calendar/gui/itip-control-factory.c
index 9c8068bde0..1fca85f10d 100644
--- a/calendar/gui/itip-control-factory.c
+++ b/calendar/gui/itip-control-factory.c
@@ -54,7 +54,7 @@ static char *
stream_read (Bonobo_Stream stream)
{
Bonobo_Stream_iobuf *buffer;
- CORBA_Environment ev;
+ CORBA_Environment ev;
gchar *data = NULL;
gint length = 0;
@@ -72,18 +72,15 @@ stream_read (Bonobo_Stream stream)
if (buffer->_length <= 0)
break;
- data = g_realloc (data,
- length + buffer->_length);
-
- memcpy (data + length,
- buffer->_buffer, buffer->_length);
-
+ data = g_realloc (data, length + buffer->_length + 1);
+ memcpy (data + length, buffer->_buffer, buffer->_length);
length += buffer->_length;
-
+ data[length] = '\0';
+
CORBA_free (buffer);
#undef READ_CHUNK_SIZE
} while (1);
-
+
CORBA_free (buffer);
CORBA_exception_free (&ev);