diff options
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r-- | ssh-keyscan.c | 12 |
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" |
10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.54 2005/05/24 17:32:44 avsm Exp $"); | 10 | RCSID("$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) | |||
166 | static char * | 166 | static char * |
167 | Linebuf_getline(Linebuf * lb) | 167 | Linebuf_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) | |||
493 | static void | 493 | static void |
494 | congreet(int s) | 494 | congreet(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; |