From ac8f49e79ee0574e083e60b557a8d45b943d2830 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 26 Apr 2016 00:00:00 -0500 Subject: [PATCH] top: miscellaneous accumulated tweaks of code/comments This commit just tries to parallel that newlib branch. It contains the following changes, which were prompted by the newlib coverity analysis which Craig initiated: . comment typo predicting 'String not null terminated' . eliminate 'Logically dead code' from insp_make_row() Some tweaks, unrelated to coverity, are also included: . use more modern (recommended) approach for time call Signed-off-by: Jim Warner --- top/top.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/top/top.c b/top/top.c index 7b4ea7dc..e8a1a782 100644 --- a/top/top.c +++ b/top/top.c @@ -982,7 +982,7 @@ static int ioch (int ech, char *buf, unsigned cnt) { // it may have been the beginning of a lengthy escape sequence tcflush(STDIN_FILENO, TCIFLUSH); - // note: we do NOT produce a vaid 'string' + // note: we do NOT produce a valid 'string' return rc; } // end: ioch @@ -2699,7 +2699,7 @@ static void sysinfo_refresh (int forced) { if (forced) mem_secs = cpu_secs = 0; - time(&cur_secs); + cur_secs = time(NULL); /*** hotplug_acclimated ***/ if (3 <= cur_secs - mem_secs) { @@ -3008,7 +3008,6 @@ static inline void insp_make_row (int col, int row) { int fr, to, ofs; int hicap = 0; - capNO; if (col < INSP_RLEN(row)) memcpy(tline, Insp_p[row] + col, sizeof(tline)); else tline[0] = '\n'; -- 2.40.0