diff options
author | Uri Simchoni <uri@samba.org> | 2017-11-19 17:11:28 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-11-24 01:13:15 +0100 |
commit | 559367ed60a316943d97a10a14ba11bcc01204c5 (patch) | |
tree | c036b864156a2193b5bcf54aa83f5ea5b7c0b9a7 /source4/torture/basic | |
parent | 899057012187954179297e1b3ae110e717702eba (diff) | |
download | samba-559367ed60a316943d97a10a14ba11bcc01204c5.tar.gz |
s4-torture: fix truncation warnings
Fix various places where there is potential truncation
while doing time / size calculations.
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture/basic')
-rw-r--r-- | source4/torture/basic/base.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 8e7ae498aef..314e8f2d131 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -190,7 +190,7 @@ static bool run_attrtest(struct torture_context *tctx, torture_comment(tctx, "New file time is %s", ctime(&t)); - if (abs(t - time(NULL)) > 60*60*24*10) { + if (labs(t - time(NULL)) > 60*60*24*10) { torture_result(tctx, TORTURE_FAIL, "ERROR: SMBgetatr bug. time is %s", ctime(&t)); t = time(NULL); @@ -289,13 +289,13 @@ static bool run_trans2test(struct torture_context *tctx, torture_comment(tctx, "modify time=%s", ctime(&m_time)); torture_comment(tctx, "This system appears to have sticky create times\n"); } - if ((abs(a_time - t) > 60) && (a_time % (60*60) == 0)) { + if ((labs(a_time - t) > 60) && (a_time % (60*60) == 0)) { torture_comment(tctx, "access time=%s", ctime(&a_time)); torture_result(tctx, TORTURE_FAIL, "This system appears to set a midnight access time\n"); correct = false; } - if (abs(m_time - t) > 60*60*24*7) { + if (labs(m_time - t) > 60*60*24*7) { torture_result(tctx, TORTURE_FAIL, "ERROR: totally incorrect times - maybe word reversed? mtime=%s", ctime(&m_time)); correct = false; } |