aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/widgets/e-minicard-control.c12
2 files changed, 12 insertions, 6 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 4cc2c98092..3ee2634773 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+2000-12-13 Dan Winship <danw@helixcode.com>
+
+ * gui/widgets/e-minicard-control.c (stream_read): NUL-terminate
+ the returned vcard so we don't sometimes end up with trailing
+ junk that makes libversit unhappy.
+
2000-12-13 Iain Holmes <iain@helixcode.com>
* gui/component/select-names/e-select-names.c
diff --git a/addressbook/gui/widgets/e-minicard-control.c b/addressbook/gui/widgets/e-minicard-control.c
index d1f7132f53..7cd57e86aa 100644
--- a/addressbook/gui/widgets/e-minicard-control.c
+++ b/addressbook/gui/widgets/e-minicard-control.c
@@ -110,11 +110,9 @@ stream_read (Bonobo_Stream stream)
if (buffer->_length <= 0)
break;
- data = g_realloc (data,
- length + buffer->_length);
+ data = g_realloc (data, length + buffer->_length + 1);
- memcpy (data + length,
- buffer->_buffer, buffer->_length);
+ memcpy (data + length, buffer->_buffer, buffer->_length);
length += buffer->_length;
@@ -124,8 +122,10 @@ stream_read (Bonobo_Stream stream)
CORBA_free (buffer);
CORBA_exception_free (&ev);
- if (data == NULL)
- data = g_strdup("");
+ if (data)
+ data[length] = '\0';
+ else
+ data = g_strdup("");
return data;
} /* stream_read */