comparison src/protocols/zephyr/zephyr.c @ 9802:acf175d9f79b

[gaim-migrate @ 10670] A wee bit o' cleanup. Rrrrrrr. Avast. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 21 Aug 2004 17:20:48 +0000
parents 62eb9fe24692
children 4d9d4940454b
comparison
equal deleted inserted replaced
9801:7aa5a20519ee 9802:acf175d9f79b
64 guint32 loctimer; 64 guint32 loctimer;
65 GList *pending_zloc_names; 65 GList *pending_zloc_names;
66 GSList *subscrips; 66 GSList *subscrips;
67 int last_id; 67 int last_id;
68 unsigned short port; 68 unsigned short port;
69 char ourhost[MAXHOSTNAMELEN]; 69 char ourhost[HOST_NAME_MAX + 1];
70 char ourhostcanon[MAXHOSTNAMELEN]; 70 char ourhostcanon[HOST_NAME_MAX + 1];
71 }; 71 };
72 72
73 /* struct I need for zephyr_to_html */ 73 /* struct I need for zephyr_to_html */
74 struct _zframe { 74 struct _zframe {
75 /* true for everything but @color, since inside the parens of that one is 75 /* true for everything but @color, since inside the parens of that one is
858 static void zephyr_inithosts(zephyr_account* zephyr) 858 static void zephyr_inithosts(zephyr_account* zephyr)
859 { 859 {
860 /* XXX This code may not be Win32 clean */ 860 /* XXX This code may not be Win32 clean */
861 struct hostent *hent; 861 struct hostent *hent;
862 862
863 if (gethostname(zephyr->ourhost, sizeof(zephyr->ourhost)-1) == -1) { 863 if (gethostname(zephyr->ourhost, sizeof(zephyr->ourhost)) == -1) {
864 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"); 864 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");
865 g_stpcpy(zephyr->ourhost,"unknown"); 865 g_strlcpy(zephyr->ourhost, "unknown", sizeof(zephyr->ourhost));
866 g_stpcpy(zephyr->ourhostcanon,"unknown"); 866 g_strlcpy(zephyr->ourhostcanon, "unknown", sizeof(zephyr->ourhost));
867 return; 867 return;
868 } 868 }
869 869
870 if (!(hent = gethostbyname(zephyr->ourhost))) { 870 if (!(hent = gethostbyname(zephyr->ourhost))) {
871 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); 871 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);
872 g_stpcpy(zephyr->ourhostcanon,zephyr->ourhost); 872 g_strlcpy(zephyr->ourhostcanon, zephyr->ourhost, sizeof(zephyr->ourhost));
873 return; 873 return;
874 } 874 }
875 g_stpcpy(zephyr->ourhostcanon,hent->h_name); 875
876 g_strlcpy(zephyr->ourhostcanon, hent->h_name, sizeof(zephyr->ourhostcanon));
877
876 return; 878 return;
877 } 879 }
878 880
879 static void process_zsubs(zephyr_account *zephyr) 881 static void process_zsubs(zephyr_account *zephyr)
880 { 882 {
881 /* Loads zephyr chats "(subscriptions) from ~/.zephyr.subs, and 883 /* Loads zephyr chats "(subscriptions) from ~/.zephyr.subs, and
882 registers (subscribes to) them on the server */ 884 registers (subscribes to) them on the server */
883 885
884 /* XXX deal with unsubscriptions */ 886 /* XXX deal with unsubscriptions */
885 /* XXX deal with punts */ 887 /* XXX deal with punts */
886 888
887 FILE *f; 889 FILE *f;
888 gchar *fname; 890 gchar *fname;
889 gchar buff[BUFSIZ]; 891 gchar buff[BUFSIZ];
890 892