aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/conduit/address-conduit.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/conduit/address-conduit.c')
-rw-r--r--addressbook/conduit/address-conduit.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
index ee6aa56541..43ba2569e0 100644
--- a/addressbook/conduit/address-conduit.c
+++ b/addressbook/conduit/address-conduit.c
@@ -96,10 +96,13 @@ print_local (EAddrLocalRecord *local)
}
if (local->addr) {
- sprintf (buff, "['%s' '%s' '%s']",
- local->addr->entry[entryLastname],
- local->addr->entry[entryFirstname],
- local->addr->entry[entryCompany]);
+ g_snprintf (buff, 4096, "['%s' '%s' '%s']",
+ local->addr->entry[entryLastname] ?
+ local->addr->entry[entryLastname] : "",
+ local->addr->entry[entryFirstname] ?
+ local->addr->entry[entryFirstname] : "",
+ local->addr->entry[entryCompany] ?
+ local->addr->entry[entryCompany] : "");
return buff;
}
@@ -119,10 +122,13 @@ static char *print_remote (GnomePilotRecord *remote)
memset (&addr, 0, sizeof (struct Address));
unpack_Address (&addr, remote->record, remote->length);
- sprintf (buff, "['%s' '%s' '%s']",
- addr.entry[entryLastname],
- addr.entry[entryFirstname],
- addr.entry[entryCompany]);
+ g_snprintf (buff, 4096, "['%s' '%s' '%s']",
+ addr.entry[entryLastname] ?
+ addr.entry[entryLastname] : "",
+ addr.entry[entryFirstname] ?
+ addr.entry[entryFirstname] : "",
+ addr.entry[entryCompany] ?
+ addr.entry[entryCompany] : "");
return buff;
}