Mercurial > pidgin.yaz
changeset 19624:f0aef60819af
merge of '0372d7dd82f502ec3e68166bf2b289e71267897a'
and '9668e3bf374a479da960a1666b880b30f104214b'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 04 Sep 2007 00:39:04 +0000 |
parents | 793973fedd02 (diff) ac9daf303942 (current diff) |
children | d47bfe67552a |
files | |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/irc/irc.c Tue Sep 04 00:37:18 2007 +0000 +++ b/libpurple/protocols/irc/irc.c Tue Sep 04 00:39:04 2007 +0000 @@ -347,6 +347,7 @@ const char *username, *realname; struct irc_conn *irc = gc->proto_data; const char *pass = purple_connection_get_password(gc); + int ret; if (pass && *pass) { buf = irc_format(irc, "vv", "PASS", pass); @@ -359,8 +360,12 @@ } - gethostname(hostname, sizeof(hostname)); + ret = gethostname(hostname, sizeof(hostname)); hostname[sizeof(hostname) - 1] = '\0'; + if (ret < 0 || hostname[0] == '\0') { + purple_debug_warning("irc", "gethostname() failed -- is your hostname set?"); + strcpy(hostname, "localhost"); + } realname = purple_account_get_string(irc->account, "realname", ""); username = purple_account_get_string(irc->account, "username", "");