Index: auth-pam.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/auth-pam.c,v
retrieving revision 1.110
diff -u -p -r1.110 auth-pam.c
--- auth-pam.c	1 Jul 2004 04:00:15 -0000	1.110
+++ auth-pam.c	3 Jul 2004 10:42:16 -0000
@@ -606,9 +606,12 @@ sshpam_query(void *ctx, char **name, cha
 		case PAM_ERROR_MSG:
 		case PAM_TEXT_INFO:
 			/* accumulate messages */
-			len = plen + strlen(msg) + 2;
-			**prompts = xrealloc(**prompts, len);
-			plen += snprintf(**prompts + plen, len, "%s\n", msg);
+			if (strlen(msg) > 0) {
+				len = plen + strlen(msg) + 2;
+				**prompts = xrealloc(**prompts, len);
+				plen += snprintf(**prompts + plen, len,
+				    "%s\n", msg);
+			}
 			xfree(msg);
 			break;
 		case PAM_SUCCESS:
@@ -887,8 +890,11 @@ sshpam_store_conv(int n, struct pam_mess
 		case PAM_ERROR_MSG:
 		case PAM_TEXT_INFO:
 			len = strlen(PAM_MSG_MEMBER(msg, i, msg));
-			buffer_append(&loginmsg, PAM_MSG_MEMBER(msg, i, msg), len);
-			buffer_append(&loginmsg, "\n", 1 );
+			if (len > 0) {
+				buffer_append(&loginmsg,
+				    PAM_MSG_MEMBER(msg, i, msg), len);
+				buffer_append(&loginmsg, "\n", 1 );
+			}
 			reply[i].resp_retcode = PAM_SUCCESS;
 			break;
 		default:
Index: session.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/session.c,v
retrieving revision 1.284
diff -u -p -r1.284 session.c
--- session.c	30 Jun 2004 23:48:29 -0000	1.284
+++ session.c	3 Jul 2004 10:23:44 -0000
@@ -198,7 +198,7 @@ display_loginmsg(void)
 {
 	if (buffer_len(&loginmsg) > 0) {
 		buffer_append(&loginmsg, "\0", 1);
-		printf("%s\n", (char *)buffer_ptr(&loginmsg));
+		printf("%s", (char *)buffer_ptr(&loginmsg));
 		buffer_clear(&loginmsg);
 	}
 	fflush(stdout);
