summaryrefslogtreecommitdiff
path: root/networking/tftp.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-06-25 10:55:35 +0000
committerDenis Vlasenko2007-06-25 10:55:35 +0000
commit80b8b39899a09c7516920cda5fd343b3086d4824 (patch)
treeaa9903fd6b64d19c5f640fa302272d85c92b204e /networking/tftp.c
parent1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff)
downloadbusybox-80b8b39899a09c7516920cda5fd343b3086d4824.zip
busybox-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'networking/tftp.c')
-rw-r--r--networking/tftp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index 8517830..b20486c 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -280,13 +280,13 @@ static int tftp( USE_GETPUT(const int cmd,)
"no such user",
"bad option",
};
- enum { NUM_ERRCODE = sizeof(errcode_str) / sizeof(errcode_str[0]) };
+
const char *msg = "";
if (rbuf[4] != '\0') {
msg = &rbuf[4];
rbuf[tftp_bufsize - 1] = '\0';
- } else if (recv_blk < NUM_ERRCODE) {
+ } else if (recv_blk < ARRAY_SIZE(errcode_str)) {
msg = errcode_str[recv_blk];
}
bb_error_msg("server error: (%u) %s", recv_blk, msg);