Explorar el Código

Make sure expiry check in dirserv_expire_measured_bw_cache() works if time_t is unsigned

Andrea Shepard hace 12 años
padre
commit
302d1dae6c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/or/dirserv.c

+ 1 - 1
src/or/dirserv.c

@@ -2125,7 +2125,7 @@ dirserv_expire_measured_bw_cache(time_t now)
       e = (mbw_cache_entry_t *)e_v;
       if (e) {
         /* Check for expiration and remove if so */
-        if (now - e->as_of > MAX_MEASUREMENT_AGE) {
+        if (now > e->as_of + MAX_MEASUREMENT_AGE) {
           tor_free(e);
           rmv = 1;
         }