fix: bw_tokens initialized to io_bwlimit, overflow check for --bwlimit

This commit is contained in:
2026-07-17 10:07:18 +02:00
parent 3dcaf0b79d
commit 4f8ae5bb70
2 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ void io_set_fds(int read_fd, int write_fd) {
void io_set_bwlimit(unsigned long long bytes_per_sec) {
io_bwlimit = bytes_per_sec;
bw_tokens = 0;
bw_tokens = (long long)io_bwlimit;
clock_gettime(CLOCK_MONOTONIC, &bw_last_refill);
}