diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-27 09:29:29 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-27 09:29:51 +0100 |
commit | 585733bcca21d83568f7c30ec7fa0fd1d8ca930b (patch) | |
tree | 50c88b2024e830e218839af67f502a74c5da81ee /opentrack | |
parent | 1f0c7e1f3031c518a5056a623c4615e275a02703 (diff) |
guard against negative sleep amount
Diffstat (limited to 'opentrack')
-rw-r--r-- | opentrack/tracker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index c96bb9b4..bb7a15c6 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -198,7 +198,7 @@ void Tracker::run() { logic(); long q = sleep_ms * 1000L - t.elapsed()/1000L; - usleep(q); + usleep(std::max(1L, q)); } { |