diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-21 18:38:51 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-21 18:38:51 +0200 |
commit | 9de2e5a22213842da5b116723392de88de9ed419 (patch) | |
tree | dff999a566382174e084d377dc3b4c03de1d4c62 /procps | |
parent | 47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5 (diff) | |
download | busybox-9de2e5a22213842da5b116723392de88de9ed419.tar.gz |
*: hopefully all setup_common_bufsiz() are in place
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r-- | procps/nmeter.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/procps/nmeter.c b/procps/nmeter.c index efa3d553d..3eac2d3b2 100644 --- a/procps/nmeter.c +++ b/procps/nmeter.c @@ -109,16 +109,15 @@ struct globals { #define proc_meminfo (G.proc_meminfo ) #define proc_diskstats (G.proc_diskstats ) #define proc_sys_fs_filenr (G.proc_sys_fs_filenr) +#define outbuf bb_common_bufsiz1 #define INIT_G() do { \ + setup_common_bufsiz(); \ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ cur_outbuf = outbuf; \ G.final_char = '\n'; \ G.deltanz = G.delta = 1000000; \ } while (0) -#define outbuf bb_common_bufsiz1 -#define sizeof_outbuf COMMON_BUFSIZE - static inline void reset_outbuf(void) { cur_outbuf = outbuf; @@ -141,7 +140,7 @@ static void print_outbuf(void) static void put(const char *s) { char *p = cur_outbuf; - int sz = outbuf + sizeof_outbuf - p; + int sz = outbuf + COMMON_BUFSIZE - p; while (*s && --sz >= 0) *p++ = *s++; cur_outbuf = p; @@ -149,7 +148,7 @@ static void put(const char *s) static void put_c(char c) { - if (cur_outbuf < outbuf + sizeof_outbuf) + if (cur_outbuf < outbuf + COMMON_BUFSIZE) *cur_outbuf++ = c; } |