# HG changeset patch # User Mark Doliner # Date 1093108848 0 # Node ID acf175d9f79b97b20802a6b7d0d759ec2bd7ea30 # Parent 7aa5a20519eee190a5fb074dcc0266b50af57426 [gaim-migrate @ 10670] A wee bit o' cleanup. Rrrrrrr. Avast. committer: Tailor Script diff -r 7aa5a20519ee -r acf175d9f79b src/protocols/zephyr/zephyr.c --- a/src/protocols/zephyr/zephyr.c Sat Aug 21 15:05:45 2004 +0000 +++ b/src/protocols/zephyr/zephyr.c Sat Aug 21 17:20:48 2004 +0000 @@ -66,8 +66,8 @@ GSList *subscrips; int last_id; unsigned short port; - char ourhost[MAXHOSTNAMELEN]; - char ourhostcanon[MAXHOSTNAMELEN]; + char ourhost[HOST_NAME_MAX + 1]; + char ourhostcanon[HOST_NAME_MAX + 1]; }; /* struct I need for zephyr_to_html */ @@ -860,29 +860,31 @@ /* XXX This code may not be Win32 clean */ struct hostent *hent; - if (gethostname(zephyr->ourhost, sizeof(zephyr->ourhost)-1) == -1) { + if (gethostname(zephyr->ourhost, sizeof(zephyr->ourhost)) == -1) { gaim_debug(GAIM_DEBUG_ERROR, "zephyr", "unable to retrieve hostname, %%host%% and %%canon%% will be wrong in subscriptions and have been set to unknown\n"); - g_stpcpy(zephyr->ourhost,"unknown"); - g_stpcpy(zephyr->ourhostcanon,"unknown"); + g_strlcpy(zephyr->ourhost, "unknown", sizeof(zephyr->ourhost)); + g_strlcpy(zephyr->ourhostcanon, "unknown", sizeof(zephyr->ourhost)); return; } if (!(hent = gethostbyname(zephyr->ourhost))) { gaim_debug(GAIM_DEBUG_ERROR,"zephyr", "unable to resolve hostname, %%canon%% will be wrong in subscriptions.and has been set to the value of %%host%%, %s\n",zephyr->ourhost); - g_stpcpy(zephyr->ourhostcanon,zephyr->ourhost); + g_strlcpy(zephyr->ourhostcanon, zephyr->ourhost, sizeof(zephyr->ourhost)); return; } - g_stpcpy(zephyr->ourhostcanon,hent->h_name); + + g_strlcpy(zephyr->ourhostcanon, hent->h_name, sizeof(zephyr->ourhostcanon)); + return; } static void process_zsubs(zephyr_account *zephyr) { - /* Loads zephyr chats "(subscriptions) from ~/.zephyr.subs, and - registers (subscribes to) them on the server */ + /* Loads zephyr chats "(subscriptions) from ~/.zephyr.subs, and + registers (subscribes to) them on the server */ - /* XXX deal with unsubscriptions */ - /* XXX deal with punts */ + /* XXX deal with unsubscriptions */ + /* XXX deal with punts */ FILE *f; gchar *fname;