about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-09-10 12:37:21 +0000
committerClint Adams <clint@users.sourceforge.net>2001-09-10 12:37:21 +0000
commit718fb33b293dbb8d72d4ef4644fcbd434a3c799b (patch)
treed978d1574d887776c219e46e07e969b5782555e1 /Src/Modules
parentcb0f8a08c7f8d95cdea766e8fd3726af49bef737 (diff)
downloadzsh-718fb33b293dbb8d72d4ef4644fcbd434a3c799b.tar.gz
zsh-718fb33b293dbb8d72d4ef4644fcbd434a3c799b.tar.xz
zsh-718fb33b293dbb8d72d4ef4644fcbd434a3c799b.zip
stupid bugfixes
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/tcp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c
index 0a81ba9db..bdc842f40 100644
--- a/Src/Modules/tcp.c
+++ b/Src/Modules/tcp.c
@@ -282,6 +282,8 @@ zts_delete(Tcp_session sess)
 
     tsess = zts_head();
 
+    if(!sess) return 1;
+
     if (tsess == sess)
     {
 	ztcp_head = sess->next;
@@ -289,15 +291,16 @@ zts_delete(Tcp_session sess)
 	return 0;
     }
 
-    while((tsess->next != sess) && (tsess->next))
-    {
+    while((tsess->next != sess) && (tsess->next)) {
 	tsess = zts_next(tsess);
     }
 
     if (!tsess->next) return 1;
 
-    tsess->next = tsess->next->next;
-    free(tsess->next);
+    if (ztcp_tail == sess)
+	    ztcp_tail = tsess;
+    tsess->next = sess->next;
+    free(sess);
     return 0;
 
 }
@@ -417,7 +420,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func)
 	    }
 	    else
 	    {
-		zwarnnam(nam, "fd not found in tcp table", NULL, 0);
+		zwarnnam(nam, "fd %s not found in tcp table", args[0], 0);
 		return 1;
 	    }
 	}