Show
Ignore:
Timestamp:
2008-07-01 20:06:03 (5 months ago)
Author:
Vincent Lefevre <vincent@…>
Branch:
HEAD
Message:

Clamp timeval math to unsigned int to match progress timestamps.
This is fine since only relative differences matter. Closes #3018.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • curs_lib.c

    r5428 r5441  
    378378  /* if timestamp is 0 no time-based suppression is done */ 
    379379  if (TimeInc) 
    380     progress->timestamp = tv.tv_sec * 1000 + tv.tv_usec / 1000; 
     380    progress->timestamp = (unsigned int) (tv.tv_sec * 1000) 
     381        + (unsigned int) (tv.tv_usec / 1000); 
    381382  mutt_progress_update (progress, 0, 0); 
    382383} 
     
    401402  /* skip refresh if not enough time has passed */ 
    402403  if (update && progress->timestamp && !gettimeofday (&tv, NULL)) { 
    403     now = tv.tv_sec * 1000 + tv.tv_usec / 1000; 
     404    now = (unsigned int) (tv.tv_sec * 1000) 
     405          + (unsigned int) (tv.tv_usec / 1000); 
    404406    if (now && now - progress->timestamp < TimeInc) 
    405407      update = 0;