Преглед изворни кода

* 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 година
родитељ
комит
53736c2c85
1 измењених фајлова са 10 додато и 1 уклоњено
  1. +10
    -1
      src/graphics.c

+ 10
- 1
src/graphics.c Прегледај датотеку

@@ -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;


Loading…
Откажи
Сачувај