summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-06-17 12:59:34 +1000
committerDamien Miller <djm@mindrot.org>2005-06-17 12:59:34 +1000
commiteccb9de72aa29da5a3fad87a4287b32438689c1f (patch)
tree9b8ef20a7e454b984e0ad67b54b2bdc5577aa2fa /ssh-keyscan.c
parent677257fe07dd2b9a58817e1d42fc2c25bb618a4d (diff)
- djm@cvs.openbsd.org 2005/06/17 02:44:33
[auth-rsa.c auth.c auth1.c auth2-chall.c auth2-gss.c authfd.c authfile.c] [bufaux.c canohost.c channels.c cipher.c clientloop.c dns.c gss-serv.c] [kex.c kex.h key.c mac.c match.c misc.c packet.c packet.h scp.c] [servconf.c session.c session.h sftp-client.c sftp-server.c sftp.c] [ssh-keyscan.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c sshd.c] make this -Wsign-compare clean; ok avsm@ markus@ NB. auth1.c changes not committed yet (conflicts with uncommitted sync) NB2. more work may be needed to make portable Wsign-compare clean
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 7dffb8517..46f063687 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$OpenBSD: ssh-keyscan.c,v 1.54 2005/05/24 17:32:44 avsm Exp $"); 10RCSID("$OpenBSD: ssh-keyscan.c,v 1.55 2005/06/17 02:44:33 djm Exp $");
11 11
12#include "openbsd-compat/sys-queue.h" 12#include "openbsd-compat/sys-queue.h"
13 13
@@ -166,7 +166,7 @@ Linebuf_lineno(Linebuf * lb)
166static char * 166static char *
167Linebuf_getline(Linebuf * lb) 167Linebuf_getline(Linebuf * lb)
168{ 168{
169 int n = 0; 169 size_t n = 0;
170 void *p; 170 void *p;
171 171
172 lb->lineno++; 172 lb->lineno++;
@@ -493,10 +493,10 @@ conrecycle(int s)
493static void 493static void
494congreet(int s) 494congreet(int s)
495{ 495{
496 int remote_major = 0, remote_minor = 0; 496 int n = 0, remote_major = 0, remote_minor = 0;
497 char buf[256], *cp; 497 char buf[256], *cp;
498 char remote_version[sizeof buf]; 498 char remote_version[sizeof buf];
499 size_t bufsiz, n = 0; 499 size_t bufsiz;
500 con *c = &fdcon[s]; 500 con *c = &fdcon[s];
501 501
502 bufsiz = sizeof(buf); 502 bufsiz = sizeof(buf);
@@ -546,12 +546,12 @@ congreet(int s)
546 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", 546 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n",
547 c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2, 547 c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2,
548 c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2); 548 c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2);
549 if (n == -1 || n >= sizeof buf) { 549 if (n < 0 || (size_t)n >= sizeof(buf)) {
550 error("snprintf: buffer too small"); 550 error("snprintf: buffer too small");
551 confree(s); 551 confree(s);
552 return; 552 return;
553 } 553 }
554 if (atomicio(vwrite, s, buf, n) != n) { 554 if (atomicio(vwrite, s, buf, n) != (size_t)n) {
555 error("write (%s): %s", c->c_name, strerror(errno)); 555 error("write (%s): %s", c->c_name, strerror(errno));
556 confree(s); 556 confree(s);
557 return; 557 return;