# HG changeset patch # User Matt Johnston # Date 1496454069 -28800 # Node ID 2688fec5602c512baf7234e6ec7f1b6f39dd8f4a # Parent 47a3a3cb7d45577760f124df13f1c03792c6af6f# Parent e8f67918fdc910f3862120c823c56fc42e4cdf07 Merge pull request #40 from fperrad/20161119_lint more lintings diff -r 47a3a3cb7d45 -r 2688fec5602c cli-runopts.c --- a/cli-runopts.c Fri Jun 02 23:35:30 2017 +0800 +++ b/cli-runopts.c Sat Jun 03 09:41:09 2017 +0800 @@ -106,7 +106,7 @@ void cli_getopts(int argc, char ** argv) { unsigned int i, j; - char ** next = 0; + char ** next = NULL; enum { OPT_EXTENDED_OPTIONS, #if DROPBEAR_CLI_PUBKEY_AUTH diff -r 47a3a3cb7d45 -r 2688fec5602c cli-session.c --- a/cli-session.c Fri Jun 02 23:35:30 2017 +0800 +++ b/cli-session.c Sat Jun 03 09:41:09 2017 +0800 @@ -81,7 +81,7 @@ {SSH_MSG_REQUEST_SUCCESS, ignore_recv_response}, {SSH_MSG_REQUEST_FAILURE, ignore_recv_response}, #endif - {0, 0} /* End */ + {0, NULL} /* End */ }; static const struct ChanType *cli_chantypes[] = { diff -r 47a3a3cb7d45 -r 2688fec5602c common-kex.c --- a/common-kex.c Fri Jun 02 23:35:30 2017 +0800 +++ b/common-kex.c Sat Jun 03 09:41:09 2017 +0800 @@ -774,7 +774,7 @@ hash_desc->done(&hs, buf_getwriteptr(ses.hash, hash_desc->hashsize)); buf_setlen(ses.hash, hash_desc->hashsize); -#if (DEBUG_KEXHASH) && (DEBUG_TRACE) +#if defined(DEBUG_KEXHASH) && DEBUG_TRACE if (!debug_trace) { printhex("kexhashbuf", ses.kexhashbuf->data, ses.kexhashbuf->len); printhex("kexhash", ses.hash->data, ses.hash->len); diff -r 47a3a3cb7d45 -r 2688fec5602c dbrandom.c --- a/dbrandom.c Fri Jun 02 23:35:30 2017 +0800 +++ b/dbrandom.c Sat Jun 03 09:41:09 2017 +0800 @@ -59,7 +59,7 @@ unsigned int readcount; int ret = DROPBEAR_FAILURE; -#if DROPBEAR_PRNGD_SOCKET +#ifdef DROPBEAR_PRNGD_SOCKET if (prngd) { readfd = connect_unix(filename); @@ -107,7 +107,7 @@ wantread = MIN(sizeof(readbuf), len-readcount); } -#if DROPBEAR_PRNGD_SOCKET +#ifdef DROPBEAR_PRNGD_SOCKET if (prngd) { char egdcmd[2]; @@ -185,7 +185,7 @@ /* existing state */ sha1_process(&hs, (void*)hashpool, sizeof(hashpool)); -#if DROPBEAR_PRNGD_SOCKET +#ifdef DROPBEAR_PRNGD_SOCKET if (process_file(&hs, DROPBEAR_PRNGD_SOCKET, INIT_SEED_SIZE, 1) != DROPBEAR_SUCCESS) { dropbear_exit("Failure reading random device %s", diff -r 47a3a3cb7d45 -r 2688fec5602c dropbearkey.c --- a/dropbearkey.c Fri Jun 02 23:35:30 2017 +0800 +++ b/dropbearkey.c Sat Jun 03 09:41:09 2017 +0800 @@ -134,7 +134,7 @@ #endif int i; - char ** next = 0; + char ** next = NULL; char * filename = NULL; enum signkey_type keytype = DROPBEAR_SIGNKEY_NONE; char * typetext = NULL; diff -r 47a3a3cb7d45 -r 2688fec5602c rsa.c --- a/rsa.c Fri Jun 02 23:35:30 2017 +0800 +++ b/rsa.c Sat Jun 03 09:41:09 2017 +0800 @@ -346,7 +346,7 @@ buf_incrwritepos(buf, ssize); mp_clear(&rsa_s); -#if defined(DEBUG_RSA) && defined(DEBUG_TRACE) +#if defined(DEBUG_RSA) && DEBUG_TRACE if (!debug_trace) { printhex("RSA sig", buf->data, buf->len); } diff -r 47a3a3cb7d45 -r 2688fec5602c svr-runopts.c --- a/svr-runopts.c Fri Jun 02 23:35:30 2017 +0800 +++ b/svr-runopts.c Sat Jun 03 09:41:09 2017 +0800 @@ -114,7 +114,7 @@ void svr_getopts(int argc, char ** argv) { unsigned int i, j; - char ** next = 0; + char ** next = NULL; int nextisport = 0; char* recv_window_arg = NULL; char* keepalive_arg = NULL; @@ -289,7 +289,7 @@ if (*next == NULL) { dropbear_exit("Invalid null argument"); } - next = 0x00; + next = NULL; if (keyfile) { addhostkey(keyfile); diff -r 47a3a3cb7d45 -r 2688fec5602c svr-session.c --- a/svr-session.c Fri Jun 02 23:35:30 2017 +0800 +++ b/svr-session.c Sat Jun 03 09:41:09 2017 +0800 @@ -66,7 +66,7 @@ {SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation}, {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure}, #endif - {0, 0} /* End */ + {0, NULL} /* End */ }; static const struct ChanType *svr_chantypes[] = { diff -r 47a3a3cb7d45 -r 2688fec5602c tcp-accept.c --- a/tcp-accept.c Fri Jun 02 23:35:30 2017 +0800 +++ b/tcp-accept.c Sat Jun 03 09:41:09 2017 +0800 @@ -55,19 +55,19 @@ static void tcp_acceptor(struct Listener *listener, int sock) { int fd; - struct sockaddr_storage addr; + struct sockaddr_storage sa; socklen_t len; char ipstring[NI_MAXHOST], portstring[NI_MAXSERV]; struct TCPListener *tcpinfo = (struct TCPListener*)(listener->typedata); - len = sizeof(addr); + len = sizeof(sa); - fd = accept(sock, (struct sockaddr*)&addr, &len); + fd = accept(sock, (struct sockaddr*)&sa, &len); if (fd < 0) { return; } - if (getnameinfo((struct sockaddr*)&addr, len, ipstring, sizeof(ipstring), + if (getnameinfo((struct sockaddr*)&sa, len, ipstring, sizeof(ipstring), portstring, sizeof(portstring), NI_NUMERICHOST | NI_NUMERICSERV) != 0) { m_close(fd);