File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,9 @@ char *my_asctime(time_t t)
556556 int len ;
557557
558558 tm = localtime (& t );
559+ if (tm == NULL )
560+ return g_strdup ("???" );
561+
559562 str = g_strdup (asctime (tm ));
560563
561564 len = strlen (str );
Original file line number Diff line number Diff line change @@ -54,23 +54,26 @@ static void nick_hash_add(CHANNEL_REC *channel, NICK_REC *nick)
5454
5555static void nick_hash_remove (CHANNEL_REC * channel , NICK_REC * nick )
5656{
57- NICK_REC * list ;
57+ NICK_REC * list , * newlist ;
5858
5959 list = g_hash_table_lookup (channel -> nicks , nick -> nick );
6060 if (list == NULL )
6161 return ;
6262
63- if (list == nick || list -> next == NULL ) {
64- g_hash_table_remove (channel -> nicks , nick -> nick );
65- if (list -> next != NULL ) {
66- g_hash_table_insert (channel -> nicks , nick -> next -> nick ,
67- nick -> next );
68- }
63+ if (list == nick ) {
64+ newlist = nick -> next ;
6965 } else {
66+ newlist = list ;
7067 while (list -> next != nick )
7168 list = list -> next ;
7269 list -> next = nick -> next ;
7370 }
71+
72+ g_hash_table_remove (channel -> nicks , nick -> nick );
73+ if (newlist != NULL ) {
74+ g_hash_table_insert (channel -> nicks , newlist -> nick ,
75+ newlist );
76+ }
7477}
7578
7679/* Add new nick to list */
You can’t perform that action at this time.
0 commit comments