top: miscellaneous accumulated tweaks of code/comments
This commit contains the following changes, which were prompted by a coverity analysis which Craig initiated: . comment typo predicting 'String not null terminated' . eliminate 'Logically dead code' from insp_make_row() And this tweak unrelated to coverity is also included: . use more modern (recommended) approach for time call Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
d2df396ba9
commit
9cdbe5b80f
@ -818,7 +818,7 @@ static int ioch (int ech, char *buf, unsigned cnt) {
|
|||||||
// it may have been the beginning of a lengthy escape sequence
|
// it may have been the beginning of a lengthy escape sequence
|
||||||
tcflush(STDIN_FILENO, TCIFLUSH);
|
tcflush(STDIN_FILENO, TCIFLUSH);
|
||||||
|
|
||||||
// note: we do NOT produce a vaid 'string'
|
// note: we do NOT produce a valid 'string'
|
||||||
return rc;
|
return rc;
|
||||||
} // end: ioch
|
} // end: ioch
|
||||||
|
|
||||||
@ -2304,7 +2304,7 @@ static void sysinfo_refresh (int forced) {
|
|||||||
|
|
||||||
if (forced)
|
if (forced)
|
||||||
mem_secs = cpu_secs = 0;
|
mem_secs = cpu_secs = 0;
|
||||||
time(&cur_secs);
|
cur_secs = time(NULL);
|
||||||
|
|
||||||
/*** hotplug_acclimated ***/
|
/*** hotplug_acclimated ***/
|
||||||
if (3 <= cur_secs - mem_secs) {
|
if (3 <= cur_secs - mem_secs) {
|
||||||
@ -2614,7 +2614,6 @@ static inline void insp_make_row (int col, int row) {
|
|||||||
int fr, to, ofs;
|
int fr, to, ofs;
|
||||||
int hicap = 0;
|
int hicap = 0;
|
||||||
|
|
||||||
capNO;
|
|
||||||
if (col < INSP_RLEN(row))
|
if (col < INSP_RLEN(row))
|
||||||
memcpy(tline, Insp_p[row] + col, sizeof(tline));
|
memcpy(tline, Insp_p[row] + col, sizeof(tline));
|
||||||
else tline[0] = '\n';
|
else tline[0] = '\n';
|
||||||
|
Loading…
Reference in New Issue
Block a user