From 9de2e5a22213842da5b116723392de88de9ed419 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 21 Apr 2016 18:38:51 +0200 Subject: *: hopefully all setup_common_bufsiz() are in place Signed-off-by: Denys Vlasenko --- procps/nmeter.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'procps') diff --git a/procps/nmeter.c b/procps/nmeter.c index efa3d55..3eac2d3 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; } -- cgit v1.1