Quellcode durchsuchen

* 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 vor 21 Jahren
Ursprung
Commit
53736c2c85
1 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. +10
    -1
      src/graphics.c

+ 10
- 1
src/graphics.c Datei anzeigen

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


Laden…
Abbrechen
Speichern