summaryrefslogtreecommitdiff
path: root/src/factor.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-05-29 15:33:59 +0100
committerPádraig Brady <P@draigBrady.com>2015-05-30 00:41:09 +0100
commitb9842a615366b47cbd0739d97f2dd2679dfbb3a8 (patch)
treec272db54a8a0539db3f6eb6416cf6c422bf8e1f2 /src/factor.c
parent17621b594a74af2cf77a7120b89add47397dbd11 (diff)
downloadcoreutils-b9842a615366b47cbd0739d97f2dd2679dfbb3a8.tar.xz
maint: avoid new coverity warnings
* src/sync.c (sync_arg): Initialise variable to avoid unitialized access if assert is disabled. * src/head.c (elide_tail_bytes_file): Support this function with ---presume-input-pipe and larger files, which regressed with commit v8.23-47-g2662702. (elide_tail_lines_file): Likewise. * src/dd.c (dd_copy): Explicitly don't try to ftruncate() upon failure to lseek() (the existing check against st_size was already protecting that). * src/factor.c (factor_using_squfof): Assert (only when linting due to performance) to avoid the implication of divide by zero. * src/od.c (read_block): Remove dead code. * src/tac.c (tac_seekable): Likewise. * src/ls.c (gobble_file): Likewise.
Diffstat (limited to 'src/factor.c')
-rw-r--r--src/factor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/factor.c b/src/factor.c
index 4e4d0c7cb..f27bf22f2 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -2055,8 +2055,9 @@ factor_using_squfof (uintmax_t n1, uintmax_t n0, struct factors *factors)
div_smallq (q, rem, S+P, Q);
P1 = S - rem; /* P1 = q*Q - P */
+ IF_LINT (assert (q > 0 && Q > 0));
+
#if STAT_SQUFOF
- assert (q > 0);
q_freq[0]++;
q_freq[MIN (q, Q_FREQ_SIZE)]++;
#endif