Index: scp.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/scp.c,v
retrieving revision 1.113
diff -u -p -r1.113 scp.c
--- scp.c	23 Nov 2003 23:21:21 -0000	1.113
+++ scp.c	1 Jan 2004 04:55:59 -0000
@@ -736,7 +736,8 @@ sink(int argc, char **argv)
 		verifydir(targ);
 
 	(void) atomicio(vwrite, remout, "", 1);
-	if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
+	if ((stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) ||
+	    strlen(targ) > 0 && targ[strlen(targ) - 1] == '/')
 		targisdir = 1;
 	for (first = 1;; first = 0) {
 		cp = buf;
Index: sshd.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/sshd.c,v
retrieving revision 1.284
diff -u -p -r1.284 sshd.c
--- sshd.c	9 Dec 2003 21:53:37 -0000	1.284
+++ sshd.c	1 Jan 2004 04:55:59 -0000
@@ -1063,16 +1063,18 @@ main(int ac, char **av)
 		if (options.protocol & SSH_PROTO_1)
 			generate_ephemeral_server_key();
 	} else {
-		for (ai = options.listen_addrs; ai; ai = ai->ai_next) {
+		for (ai = options.listen_addrs; ai != NULL; ai = ai->ai_next) {
 			if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
 				continue;
 			if (num_listen_socks >= MAX_LISTEN_SOCKS)
 				fatal("Too many listen sockets. "
 				    "Enlarge MAX_LISTEN_SOCKS");
-			if (getnameinfo(ai->ai_addr, ai->ai_addrlen,
+			if ((ret = getnameinfo(ai->ai_addr, ai->ai_addrlen,
 			    ntop, sizeof(ntop), strport, sizeof(strport),
-			    NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
-				error("getnameinfo failed");
+			    NI_NUMERICHOST|NI_NUMERICSERV)) != 0) {
+				error("getnameinfo failed: %.100s",
+				    (ret != EAI_SYSTEM) ? gai_strerror(ret) :
+				    strerror(errno));
 				continue;
 			}
 			/* Create socket for listening. */
