diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 14:55:35 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 14:55:35 +0400 |
commit | 80b8b39899a09c7516920cda5fd343b3086d4824 (patch) | |
tree | aa9903fd6b64d19c5f640fa302272d85c92b204e /networking/tftp.c | |
parent | 1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff) |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index 8517830b7..b20486cc1 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); |