# HG changeset patch # User Rob Flynn # Date 977197573 0 # Node ID 7f4302f6fd64d69873cc49515213c3e1ceac6c67 # Parent 9c34f99af79ee9fd2dc23f817935eef64814c949 [gaim-migrate @ 1314] No more port crashy. committer: Tailor Script diff -r 9c34f99af79e -r 7f4302f6fd64 plugins/irc.c --- a/plugins/irc.c Tue Dec 19 03:28:33 2000 +0000 +++ b/plugins/irc.c Tue Dec 19 03:46:13 2000 +0000 @@ -978,7 +978,13 @@ site.sin_family = AF_INET; site.sin_addr.s_addr = *(long *)(host->h_addr); - site.sin_port = htons(atoi(user->proto_opt[1])); + + if (user->proto_opt[1][0]) + site.sin_port = htons(atoi(user->proto_opt[1])); + else { + site.sin_port = htons(6667); + g_snprintf(user->proto_opt[1], 5, "6667"); + } fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) { @@ -1064,6 +1070,8 @@ if (user->proto_opt[1][0]) { debug_printf("setting text %s\n", user->proto_opt[1]); gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[1]); + } else { + gtk_entry_set_text(GTK_ENTRY(entry), "6667"); } gtk_object_set_user_data(GTK_OBJECT(entry), user); gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(irc_print_option), user);