summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-27 09:29:29 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-10-27 09:29:51 +0100
commit585733bcca21d83568f7c30ec7fa0fd1d8ca930b (patch)
tree50c88b2024e830e218839af67f502a74c5da81ee /opentrack
parent1f0c7e1f3031c518a5056a623c4615e275a02703 (diff)
guard against negative sleep amount
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/tracker.cpp2
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));
}
{