summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-02-10 23:18:11 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-02-10 23:18:11 +0000
commitc791bebc2a0e15af332151502ca56c4d7f15ebc1 (patch)
treef1527f8a2a57b5e54f1a56c89e5fc01f5ca0ca62 /ssh-keyscan.c
parent28072eb10c8a45f7dbe2deb08f6db8c3461d8022 (diff)
- itojun@cvs.openbsd.org 2001/02/07 18:04:50
[ssh-keyscan.c] fix size_t -> int cast (use u_long). markus ok - markus@cvs.openbsd.org 2001/02/07 22:43:16 [ssh-keyscan.c] s/getline/Linebuf_getline/; from roumen.petrov@skalasoft.com - itojun@cvs.openbsd.org 2001/02/09 9:04:59 [ssh-keyscan.c] do not assume malloc() returns zero-filled region. found by malloc.conf=AJ.
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index e48c0865e..834649fef 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$OpenBSD: ssh-keyscan.c,v 1.12 2001/02/04 15:32:26 stevesk Exp $"); 11RCSID("$OpenBSD: ssh-keyscan.c,v 1.15 2001/02/09 09:04:59 itojun Exp $");
12 12
13#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) 13#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
14#include <sys/queue.h> 14#include <sys/queue.h>
@@ -146,7 +146,7 @@ Linebuf_lineno(Linebuf * lb)
146} 146}
147 147
148static inline char * 148static inline char *
149getline(Linebuf * lb) 149Linebuf_getline(Linebuf * lb)
150{ 150{
151 int n = 0; 151 int n = 0;
152 152
@@ -490,7 +490,7 @@ conloop(void)
490 seltime = c->c_tv; 490 seltime = c->c_tv;
491 seltime.tv_sec -= now.tv_sec; 491 seltime.tv_sec -= now.tv_sec;
492 seltime.tv_usec -= now.tv_usec; 492 seltime.tv_usec -= now.tv_usec;
493 if ((int) seltime.tv_usec < 0) { 493 if (seltime.tv_usec < 0) {
494 seltime.tv_usec += 1000000; 494 seltime.tv_usec += 1000000;
495 seltime.tv_sec--; 495 seltime.tv_sec--;
496 } 496 }
@@ -547,7 +547,7 @@ nexthost(int argc, char **argv)
547 error("ignoring invalid/misplaced option `%s'", argv[argno++]); 547 error("ignoring invalid/misplaced option `%s'", argv[argno++]);
548 } else { 548 } else {
549 char *line; 549 char *line;
550 line = getline(lb); 550 line = Linebuf_getline(lb);
551 if (line) 551 if (line)
552 return (line); 552 return (line);
553 Linebuf_free(lb); 553 Linebuf_free(lb);
@@ -599,6 +599,7 @@ main(int argc, char **argv)
599 if (maxfd > fdlim_get(0)) 599 if (maxfd > fdlim_get(0))
600 fdlim_set(maxfd); 600 fdlim_set(maxfd);
601 fdcon = xmalloc(maxfd * sizeof(con)); 601 fdcon = xmalloc(maxfd * sizeof(con));
602 memset(fdcon, 0, maxfd * sizeof(con));
602 603
603 do { 604 do {
604 while (ncon < maxcon) { 605 while (ncon < maxcon) {