aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-20 16:54:19 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-20 16:54:19 +0000
commit316355524f5fa14f18395c06d4dc813ffa97d47b (patch)
treed6fbd44c510bef0ebf57cd81bee8e009040fa3f4 /networking
parent91f20ab510a6ddab49dd89f8c8876912d4537be0 (diff)
downloadbusybox-316355524f5fa14f18395c06d4dc813ffa97d47b.tar.gz
busybox-316355524f5fa14f18395c06d4dc813ffa97d47b.tar.bz2
fixing bugs revealed by randomconfig runs
Diffstat (limited to 'networking')
-rw-r--r--networking/nc.c2
-rw-r--r--networking/tftp.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/networking/nc.c b/networking/nc.c
index 37e658d4b..09d89b0a8 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -23,8 +23,8 @@ int nc_main(int argc, char **argv)
/* sfd sits _here_ only because of "repeat" option (-l -l). */
int sfd = sfd; /* for gcc */
int cfd = 0;
+ unsigned lport = 0;
SKIP_NC_SERVER(const) unsigned do_listen = 0;
- SKIP_NC_SERVER(const) unsigned lport = 0;
SKIP_NC_EXTRA (const) unsigned wsecs = 0;
SKIP_NC_EXTRA (const) unsigned delay = 0;
SKIP_NC_EXTRA (const int execparam = 0;)
diff --git a/networking/tftp.c b/networking/tftp.c
index 9aa87d57e..eb192d8fc 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -22,6 +22,8 @@
#include "busybox.h"
+#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT
+
#define TFTP_BLOCKSIZE_DEFAULT 512 /* according to RFC 1350, don't change */
#define TFTP_TIMEOUT 5 /* seconds */
#define TFTP_NUM_RETRIES 5 /* number of retries */
@@ -56,8 +58,8 @@ static const char *const tftp_bb_error_msg[] = {
#else
#define USE_GETPUT(a) a
/* masks coming from getpot32 */
-#define CMD_GET(cmd) (cmd & 1)
-#define CMD_PUT(cmd) (cmd & 2)
+#define CMD_GET(cmd) ((cmd) & 1)
+#define CMD_PUT(cmd) ((cmd) & 2)
#endif
/* NB: in the code below
* CMD_GET(cmd) and CMD_GET(cmd) are mutually exclusive
@@ -508,3 +510,5 @@ int tftp_main(int argc, char **argv)
}
return result;
}
+
+#endif /* ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT */