summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/nmeter.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/miscutils/nmeter.c b/miscutils/nmeter.c
index 3152b74..1d58eb2 100644
--- a/miscutils/nmeter.c
+++ b/miscutils/nmeter.c
@@ -69,16 +69,16 @@ struct globals {
#define proc_meminfo (G.proc_meminfo )
#define proc_diskstats (G.proc_diskstats )
#define proc_sys_fs_filenr (G.proc_sys_fs_filenr)
-
-// We depend on this being a char[], not char* - we take sizeof() of it
-#define outbuf bb_common_bufsiz1
-
#define INIT_G() do { \
+ PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
cur_outbuf = outbuf; \
final_str = "\n"; \
deltanz = delta = 1000000; \
} while (0)
+// We depend on this being a char[], not char* - we take sizeof() of it
+#define outbuf bb_common_bufsiz1
+
static inline void reset_outbuf(void)
{
cur_outbuf = outbuf;
@@ -774,7 +774,6 @@ int nmeter_main(int argc, char **argv)
s_stat *s;
char *cur, *prev;
- PTR_TO_GLOBALS = xzalloc(sizeof(G));
INIT_G();
xchdir("/proc");