summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Long <ryan.long@oarcorp.com>2021-03-12 15:25:40 -0500
committerJoel Sherrill <joel@rtems.org>2021-04-08 17:58:19 -0500
commit0b2366024d1350b2defc27d5a8669da4dd7a56f1 (patch)
tree9e055ef74efe8c90ba709de68429f35a831c1d30
parentmain_cp.c: Unused value (CID #1255344) (diff)
downloadrtems-0b2366024d1350b2defc27d5a8669da4dd7a56f1.tar.bz2
print-ls.c: Unused value (CID #1255346)
CID 1255346: Unused value in rtems_shell_ls_printacol(). Closes #4340
-rw-r--r--cpukit/libmisc/shell/print-ls.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cpukit/libmisc/shell/print-ls.c b/cpukit/libmisc/shell/print-ls.c
index 15702b4931..95a2cdfb6c 100644
--- a/cpukit/libmisc/shell/print-ls.c
+++ b/cpukit/libmisc/shell/print-ls.c
@@ -325,7 +325,16 @@ printacol(rtems_shell_ls_globals* globals, DISPLAY *dp)
if (IS_NOPRINT(p))
continue;
if (col >= numcols) {
+ #ifdef __rtems__
+ /*
+ * chcnt is not using the value that it has been assigned
+ * before being used again, resulting in a Coverity issue.
+ * See CID 1255346
+ */
+ col = 0;
+ #else
chcnt = col = 0;
+ #endif
(void)putchar('\n');
}
chcnt = printaname(globals, p, dp->s_inode,