comparison libpurple/protocols/bonjour/bonjour.c @ 15932:a26cbbd1409c

Minor cleanup
author Mark Doliner <mark@kingant.net>
date Mon, 26 Mar 2007 04:59:53 +0000
parents d7feace39800
children 56f0049d3207
comparison
equal deleted inserted replaced
15931:c2cce5daa8ec 15932:a26cbbd1409c
458 else if ((info != NULL) && (info->pw_name != NULL) && (info->pw_name[0] != '\0')) 458 else if ((info != NULL) && (info->pw_name != NULL) && (info->pw_name[0] != '\0'))
459 fullname = info->pw_name; 459 fullname = info->pw_name;
460 else if (((fullname = getlogin()) != NULL) && (fullname[0] != '\0')) 460 else if (((fullname = getlogin()) != NULL) && (fullname[0] != '\0'))
461 ; 461 ;
462 else 462 else
463 fullname = _("John Noname"); 463 fullname = _("Purple Person");
464 /* Make sure fullname is valid UTF-8. If not, try to convert it. */ 464 /* Make sure fullname is valid UTF-8. If not, try to convert it. */
465 if (!g_utf8_validate(fullname, -1, NULL)) 465 if (!g_utf8_validate(fullname, -1, NULL))
466 { 466 {
467 gchar *tmp; 467 gchar *tmp;
468 tmp = g_locale_to_utf8(fullname, -1, NULL, NULL, NULL); 468 tmp = g_locale_to_utf8(fullname, -1, NULL, NULL, NULL);
546 #endif 546 #endif
547 547
548 /* Try to figure out a good host name to use */ 548 /* Try to figure out a good host name to use */
549 /* TODO: Avoid 'localhost,' if possible */ 549 /* TODO: Avoid 'localhost,' if possible */
550 if (gethostname(hostname, 255) != 0) { 550 if (gethostname(hostname, 255) != 0) {
551 purple_debug_warning("bonjour", "Error %d when getting host name. Using \"localhost.\"\n", errno); 551 purple_debug_warning("bonjour", "Error when getting host name: %s. Using \"localhost.\"\n",
552 strerror(errno));
552 strcpy(hostname, "localhost"); 553 strcpy(hostname, "localhost");
553 } 554 }
554 default_hostname = g_strdup(hostname); 555 default_hostname = g_strdup(hostname);
555 } 556 }
556 557