aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-12-14 03:35:39 +0800
committerDan Winship <danw@src.gnome.org>2000-12-14 03:35:39 +0800
commitdcf7f4519e835359776c88b9ad413dbae497452a (patch)
tree20aebc6851bbb9f7b441873493ba1738b7913034
parentfe7da31d862feb3175a507bdb594341cac721f22 (diff)
downloadgsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.tar.gz
gsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.tar.zst
gsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.zip
NUL-terminate the returned vcard so we don't sometimes end up with
* 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. svn path=/trunk/; revision=6970
-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 */