Bläddra i källkod

* src/graphics.c:

+ Fixed a bug that caused an infinite loop if the delay between two
      caca_refresh() calls was greater than 2000 seconds (or something).
tags/v0.99.beta14
Sam Hocevar sam 21 år sedan
förälder
incheckning
53736c2c85
1 ändrade filer med 10 tillägg och 1 borttagningar
  1. +10
    -1
      src/graphics.c

+ 10
- 1
src/graphics.c Visa fil

@@ -819,7 +819,16 @@ static unsigned int _caca_getticks(void)

if(last_sec != 0)
{
ticks = (tv.tv_sec - last_sec) * 1000000 + (tv.tv_usec - last_usec);
/* If the delay was greater than 60 seconds, return 10 seconds
* otherwise we may overflow our ticks counter. */
if(tv.tv_sec >= last_sec + 60)
ticks = 60 * 1000000;
else
{
ticks = (tv.tv_sec - last_sec) * 1000000;
ticks += tv.tv_usec;
ticks -= last_usec;
}
}

last_sec = tv.tv_sec;


Laddar…
Avbryt
Spara