# HG changeset patch # User Matt Johnston # Date 1453296276 -28800 # Node ID 00d7fc7b112b728d8e5807f222b8444265f214ea # Parent f7f2c37142694c491bf9f34e0362036a33f47c0d# Parent c59c10803afd796108e0e6fa4558e52d6b3ab577 Merge pull request #21 from Chocobo1/fix Fix warnings diff -r f7f2c3714269 -r 00d7fc7b112b cli-runopts.c --- a/cli-runopts.c Tue Jan 19 00:34:37 2016 +0800 +++ b/cli-runopts.c Wed Jan 20 21:24:36 2016 +0800 @@ -538,7 +538,7 @@ 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 -r f7f2c3714269 -r 00d7fc7b112b cli-tcpfwd.c --- a/cli-tcpfwd.c Tue Jan 19 00:34:37 2016 +0800 +++ b/cli-tcpfwd.c Wed Jan 20 21:24:36 2016 +0800 @@ -273,7 +273,7 @@ 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 -r f7f2c3714269 -r 00d7fc7b112b compat.c --- a/compat.c Tue Jan 19 00:34:37 2016 +0800 +++ b/compat.c Wed Jan 20 21:24:36 2016 +0800 @@ -235,7 +235,7 @@ 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 -r f7f2c3714269 -r 00d7fc7b112b svr-authpam.c --- a/svr-authpam.c Tue Jan 19 00:34:37 2016 +0800 +++ b/svr-authpam.c Wed Jan 20 21:24:36 2016 +0800 @@ -218,7 +218,7 @@ } /* 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 -r f7f2c3714269 -r 00d7fc7b112b svr-session.c --- a/svr-session.c Tue Jan 19 00:34:37 2016 +0800 +++ b/svr-session.c Wed Jan 20 21:24:36 2016 +0800 @@ -160,7 +160,7 @@ } 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 -r f7f2c3714269 -r 00d7fc7b112b svr-tcpfwd.c --- a/svr-tcpfwd.c Tue Jan 19 00:34:37 2016 +0800 +++ b/svr-tcpfwd.c Wed Jan 20 21:24:36 2016 +0800 @@ -269,7 +269,7 @@ 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 -r f7f2c3714269 -r 00d7fc7b112b svr-x11fwd.c --- a/svr-x11fwd.c Tue Jan 19 00:34:37 2016 +0800 +++ b/svr-x11fwd.c Wed Jan 20 21:24:36 2016 +0800 @@ -142,7 +142,7 @@ } /* 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 @@ 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 -r f7f2c3714269 -r 00d7fc7b112b tcp-accept.c --- a/tcp-accept.c Tue Jan 19 00:34:37 2016 +0800 +++ b/tcp-accept.c Wed Jan 20 21:24:36 2016 +0800 @@ -121,7 +121,7 @@ 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);