diff options
-rw-r--r-- | cli-session.c | 4 | ||||
-rw-r--r-- | common-channel.c | 4 | ||||
-rw-r--r-- | dbutil.c | 8 | ||||
-rw-r--r-- | random.c | 2 | ||||
-rw-r--r-- | session.h | 6 | ||||
-rw-r--r-- | svr-main.c | 5 | ||||
-rw-r--r-- | svr-session.c | 2 | ||||
-rw-r--r-- | tcp-accept.c | 2 |
8 files changed, 16 insertions, 17 deletions
diff --git a/cli-session.c b/cli-session.c index be36bec..360187f 100644 --- a/cli-session.c +++ b/cli-session.c @@ -215,8 +215,8 @@ static void cli_sessionloop() { if (cli_opts.backgrounded) { int devnull; - // keeping stdin open steals input from the terminal and - // is confusing, though stdout/stderr could be useful. + /* keeping stdin open steals input from the terminal and + is confusing, though stdout/stderr could be useful. */ devnull = open(_PATH_DEVNULL, O_RDONLY); if (devnull < 0) { dropbear_exit("opening /dev/null: %d %s", diff --git a/common-channel.c b/common-channel.c index fdaeb24..34316b4 100644 --- a/common-channel.c +++ b/common-channel.c @@ -461,7 +461,7 @@ void setchannelfds(fd_set *readfds, fd_set *writefds) { FD_SET(channel->writefd, writefds); } - if (ERRFD_IS_WRITE(channel) != NULL && channel->errfd >= 0 + if (ERRFD_IS_WRITE(channel) && channel->errfd >= 0 && cbuf_getused(channel->extrabuf) > 0 ) { FD_SET(channel->errfd, writefds); } @@ -640,7 +640,7 @@ static void send_msg_channel_data(struct Channel *channel, int isextended) { /* If we receive less data than we requested when flushing, we've reached the equivalent of EOF */ - if (channel->flushing && len < maxlen) + if (channel->flushing && len < (ssize_t)maxlen) { TRACE(("closing from channel, flushing out.")) close_chan_fd(channel, fd, SHUT_RD); @@ -199,10 +199,10 @@ int dropbear_listen(const char* address, const char* port, hints.ai_family = AF_UNSPEC; /* TODO: let them flag v4 only etc */ hints.ai_socktype = SOCK_STREAM; - // for calling getaddrinfo: - // address == NULL and !AI_PASSIVE: local loopback - // address == NULL and AI_PASSIVE: all interfaces - // address != NULL: whatever the address says + /* for calling getaddrinfo: + address == NULL and !AI_PASSIVE: local loopback + address == NULL and AI_PASSIVE: all interfaces + address != NULL: whatever the address says */ if (!address) { TRACE(("dropbear_listen: local loopback")) } else { @@ -214,7 +214,7 @@ void gen_random_mpint(mp_int *max, mp_int *rand) { unsigned char *randbuf = NULL; unsigned int len = 0; - const char masks[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; + const unsigned char masks[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; const int size_bits = mp_count_bits(max); @@ -190,8 +190,7 @@ typedef enum { KEX_NOTHING, KEXINIT_RCVD, KEXDH_INIT_SENT, - KEXDONE, - + KEXDONE } cli_kex_state; typedef enum { @@ -203,8 +202,7 @@ typedef enum { USERAUTH_REQ_SENT, USERAUTH_FAIL_RCVD, USERAUTH_SUCCESS_RCVD, - SESSION_RUNNING, - + SESSION_RUNNING } cli_state; struct clientsession { @@ -125,8 +125,9 @@ void main_noinetd() { int childsock; int childpipe[2]; - // Note: commonsetup() must happen before we daemon()ise. Otherwise - // daemon() will chdir("/"), and we won't be able to find local-dir hostkeys. + /* Note: commonsetup() must happen before we daemon()ise. Otherwise + daemon() will chdir("/"), and we won't be able to find local-dir + hostkeys. */ commonsetup(); /* fork */ diff --git a/svr-session.c b/svr-session.c index fe78bcc..3701597 100644 --- a/svr-session.c +++ b/svr-session.c @@ -188,7 +188,7 @@ void svr_dropbear_log(int priority, const char* format, va_list param) { || strftime(datestr, sizeof(datestr), "%b %d %H:%M:%S", localtime(×ec)) == 0) { - // upon failure, just print the epoch-seconds time. + /* upon failure, just print the epoch-seconds time. */ snprintf(datestr, sizeof(datestr), "%d", timesec); } fprintf(stderr, "[%d] %s %s\n", getpid(), datestr, printbuf); diff --git a/tcp-accept.c b/tcp-accept.c index 14a6312..7457c9b 100644 --- a/tcp-accept.c +++ b/tcp-accept.c @@ -104,7 +104,7 @@ int listen_tcpfwd(struct TCPListener* tcpinfo) { struct Listener *listener = NULL; int nsocks; char* errstring = NULL; - // listen_spec = NULL indicates localhost + /* listen_spec = NULL indicates localhost */ const char* listen_spec = NULL; TRACE(("enter listen_tcpfwd")) |