# HG changeset patch # User Evan Schoenberg # Date 1178106904 0 # Node ID e3f4f1fd8f3df375b392d36ecc3684bbd1b7d8ff # Parent b63ef2b2acfca2675034f31dbfd4d4b843037f30# Parent a9975d6c28321203e201c4398c9ec8035bd234ec merge of '92952767b5290dd3324e325476ad8aecd0e2a3f1' and 'edbf1afe63dd8077f9c4287f723010c769239720' diff -r b63ef2b2acfc -r e3f4f1fd8f3d libpurple/protocols/bonjour/bonjour.c --- a/libpurple/protocols/bonjour/bonjour.c Wed May 02 07:04:07 2007 +0000 +++ b/libpurple/protocols/bonjour/bonjour.c Wed May 02 11:55:04 2007 +0000 @@ -460,6 +460,7 @@ const char *fullname = NULL; #endif char *splitpoint = NULL; + char *tmp; char hostname[255]; #ifndef _WIN32 @@ -545,7 +546,16 @@ if (splitpoint != NULL) { default_firstname = g_strndup(fullname, splitpoint - fullname); - default_lastname = g_strdup(&splitpoint[1]); + tmp = &splitpoint[1]; + + /* The last name may be followed by a comma and additional data. + * Only use the last name itself. + */ + splitpoint = strchr(tmp, ','); + if (splitpoint != NULL) + default_lastname = g_strndup(tmp, splitpoint - tmp); + else + default_lastname = g_strdup(tmp); } else {