summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2022-11-02 22:37:35 +0000
committerThomas Habets <thomas@habets.se>2022-11-02 22:37:35 +0000
commit9280306c4a95487de7e28aec660a0e58553d2b6f (patch)
tree21d0ff2cb700ba610ab58cb5396102c59b6e0456
parent5352988a141fbd410f0ecc9028d89e6a185d5365 (diff)
downloadarping-9280306c4a95487de7e28aec660a0e58553d2b6f.tar.gz
Explicitly cast double to uint32, to suppress warning
-rw-r--r--src/arping.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arping.c b/src/arping.c
index b16755e..58060cb 100644
--- a/src/arping.c
+++ b/src/arping.c
@@ -1227,7 +1227,10 @@ wait_time(double deadline, uint32_t packetwait)
if (max_wait > packetwait / 1000000.0) {
return packetwait;
}
- return max_wait * 1000000;
+
+ // TODO: check for overflows. Though what's the worst that
+ // could happen?
+ return (uint32_t)(max_wait * 1000000);
}
/**