summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cli-runopts.c2
-rw-r--r--cli-tcpfwd.c2
-rw-r--r--compat.c2
-rw-r--r--svr-authpam.c2
-rw-r--r--svr-session.c2
-rw-r--r--svr-tcpfwd.c2
-rw-r--r--svr-x11fwd.c4
-rw-r--r--tcp-accept.c2
8 files changed, 9 insertions, 9 deletions
diff --git a/cli-runopts.c b/cli-runopts.c
index ab25d37..8d1edee 100644
--- a/cli-runopts.c
+++ b/cli-runopts.c
@@ -538,7 +538,7 @@ multihop_passthrough_args() {
if (opts.recv_window != DEFAULT_RECV_WINDOW)
{
- int written = snprintf(ret+total, len-total, "-W %d ", opts.recv_window);
+ int written = snprintf(ret+total, len-total, "-W %u ", opts.recv_window);
total += written;
}
diff --git a/cli-tcpfwd.c b/cli-tcpfwd.c
index fec5dba..b32d9e0 100644
--- a/cli-tcpfwd.c
+++ b/cli-tcpfwd.c
@@ -273,7 +273,7 @@ static int newtcpforwarded(struct Channel * channel) {
goto out;
}
- snprintf(portstring, sizeof(portstring), "%d", fwd->connectport);
+ snprintf(portstring, sizeof(portstring), "%u", fwd->connectport);
channel->conn_pending = connect_remote(fwd->connectaddr, portstring, channel_connect_done, channel);
channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE;
diff --git a/compat.c b/compat.c
index a689a14..71558a5 100644
--- a/compat.c
+++ b/compat.c
@@ -235,7 +235,7 @@ void setusershell() {
static char **initshells() {
/* don't touch this list. */
- const char *okshells[] = { "/bin/sh", "/bin/csh", NULL };
+ static const char *okshells[] = { "/bin/sh", "/bin/csh", NULL };
register char **sp, *cp;
register FILE *fp;
struct stat statb;
diff --git a/svr-authpam.c b/svr-authpam.c
index 101017c..98505ba 100644
--- a/svr-authpam.c
+++ b/svr-authpam.c
@@ -218,7 +218,7 @@ void svr_auth_pam() {
}
/* just to set it to something */
- if ((rc = pam_set_item(pamHandlep, PAM_TTY, "ssh") != PAM_SUCCESS)) {
+ if ((rc = pam_set_item(pamHandlep, PAM_TTY, "ssh")) != PAM_SUCCESS) {
dropbear_log(LOG_WARNING, "pam_set_item() failed, rc=%d, %s",
rc, pam_strerror(pamHandlep, rc));
goto cleanup;
diff --git a/svr-session.c b/svr-session.c
index f777b5f..254a747 100644
--- a/svr-session.c
+++ b/svr-session.c
@@ -160,7 +160,7 @@ void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
} else if (ses.authstate.pw_name) {
/* we have a potential user */
snprintf(fmtbuf, sizeof(fmtbuf),
- "Exit before auth (user '%s', %d fails): %s",
+ "Exit before auth (user '%s', %u fails): %s",
ses.authstate.pw_name, ses.authstate.failcount, format);
} else {
/* before userauth */
diff --git a/svr-tcpfwd.c b/svr-tcpfwd.c
index d2f1427..9d051bf 100644
--- a/svr-tcpfwd.c
+++ b/svr-tcpfwd.c
@@ -269,7 +269,7 @@ static int newtcpdirect(struct Channel * channel) {
goto out;
}
- snprintf(portstring, sizeof(portstring), "%d", destport);
+ snprintf(portstring, sizeof(portstring), "%u", destport);
channel->conn_pending = connect_remote(desthost, portstring, channel_connect_done, channel);
channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE;
diff --git a/svr-x11fwd.c b/svr-x11fwd.c
index 144ec0b..9e7df24 100644
--- a/svr-x11fwd.c
+++ b/svr-x11fwd.c
@@ -142,7 +142,7 @@ void x11setauth(struct ChanSess *chansess) {
}
/* create the DISPLAY string */
- val = snprintf(display, sizeof(display), "localhost:%d.%d",
+ val = snprintf(display, sizeof(display), "localhost:%d.%u",
chansess->x11port - X11BASEPORT, chansess->x11screennum);
if (val < 0 || val >= (int)sizeof(display)) {
/* string was truncated */
@@ -152,7 +152,7 @@ void x11setauth(struct ChanSess *chansess) {
addnewvar("DISPLAY", display);
/* create the xauth string */
- val = snprintf(display, sizeof(display), "unix:%d.%d",
+ val = snprintf(display, sizeof(display), "unix:%d.%u",
chansess->x11port - X11BASEPORT, chansess->x11screennum);
if (val < 0 || val >= (int)sizeof(display)) {
/* string was truncated */
diff --git a/tcp-accept.c b/tcp-accept.c
index 4456920..f1f51a7 100644
--- a/tcp-accept.c
+++ b/tcp-accept.c
@@ -121,7 +121,7 @@ int listen_tcpfwd(struct TCPListener* tcpinfo) {
TRACE(("enter listen_tcpfwd"))
/* first we try to bind, so don't need to do so much cleanup on failure */
- snprintf(portstring, sizeof(portstring), "%d", tcpinfo->listenport);
+ snprintf(portstring, sizeof(portstring), "%u", tcpinfo->listenport);
nsocks = dropbear_listen(tcpinfo->listenaddr, portstring, socks,
DROPBEAR_MAX_SOCKS, &errstring, &ses.maxfd);