aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
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 /addressbook/gui
parentfe7da31d862feb3175a507bdb594341cac721f22 (diff)
downloadgsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.tar
gsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.tar.gz
gsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.tar.bz2
gsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.tar.lz
gsoc2013-evolution-dcf7f4519e835359776c88b9ad413dbae497452a.tar.xz
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
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/widgets/e-minicard-control.c12
1 files changed, 6 insertions, 6 deletions
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 */