1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:utils: Use floating-point arithmetic when result is assigned to a double

This avoids any loss of precision from performing an integer division.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Joseph Sutton 2023-05-01 14:15:26 +12:00 committed by Jeremy Allison
parent 4dccf5afa4
commit d2720a9e78

View File

@ -627,7 +627,7 @@ static bool smb_download_file(const char *base, const char *name,
/* Pause until `ticks_to_fill_bucket` */
double sleep_us
= (ticks_to_fill_bucket - diff_ticks)
* 1000000 / CLOCKS_PER_SEC;
* 1000000.0 / CLOCKS_PER_SEC;
usleep(sleep_us);
}
/* Reset the byte counter and the ticks. */