summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2009-09-30 02:39:57 +0200
committerDenys Vlasenko2009-09-30 02:39:57 +0200
commit1b34d4f0b1d634eb8219d52c693fa80b99ed1bfa (patch)
tree1fa51b9580409d4fa8de86bf8c9b2ab083caf10d /networking
parentc34c033c4256f88e759c5f7a59526b4397852a82 (diff)
downloadbusybox-1b34d4f0b1d634eb8219d52c693fa80b99ed1bfa.zip
busybox-1b34d4f0b1d634eb8219d52c693fa80b99ed1bfa.tar.gz
find: add zeroing of G.xxx; ftpd - remove extraneous zeroing of G.xxx
Brought "G trick" to the same shape in a few more places. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/ftpd.c4
-rw-r--r--networking/telnet.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index a8687fb..70a3533 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -662,7 +662,7 @@ popen_ls(const char *opt)
execv(bb_busybox_exec_path + 1, (char**) argv);
_exit(127);
#else
- memset(&G, 0, sizeof(G));
+ /* memset(&G, 0, sizeof(G)); - ls_main does it */
exit(ls_main(ARRAY_SIZE(argv) - 1, (char**) argv));
#endif
}
@@ -1114,7 +1114,7 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv)
/* --group-directories-first would be nice, but ls don't do that yet */
xchdir(argv[2]);
argv[2] = (char*)"--";
- memset(&G, 0, sizeof(G));
+ /* memset(&G, 0, sizeof(G)); - ls_main does it */
return ls_main(argc, argv);
}
#endif
diff --git a/networking/telnet.c b/networking/telnet.c
index cc99425..77e1747 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -77,11 +77,10 @@ struct globals {
struct termios termios_raw;
};
#define G (*(struct globals*)&bb_common_bufsiz1)
-void BUG_telnet_globals_too_big(void);
#define INIT_G() do { \
- if (sizeof(G) > COMMON_BUFSIZE) \
- BUG_telnet_globals_too_big(); \
- /* memset(&G, 0, sizeof G); - already is */ \
+ struct G_sizecheck { \
+ char G_sizecheck[sizeof(G) > COMMON_BUFSIZE ? -1 : 1]; \
+ }; \
} while (0)
/* Function prototypes */