Wireshark-commits: [Wireshark-commits] master 993adc8: Fix counting/ checking for leap years in mkt
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 24 Apr 2014 06:02:49 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=993adc84d5a5be1ec2e69e8ed3db11fb220a4ad6
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

993adc8 by Jakub Zawadzki (darkjames@xxxxxxxxxxxx):

    Fix counting/ checking for leap years in mktime_utc()
    
    When HAVE_TIMEGM is undefined mktime_utc() might output one day shift (+86400s)
    for (years <= 1967 or years >= 2100) && month >= 3
    
    { .tm_mday = 1 .tm_mon = 2 .tm_year = 67 }
    mktime_utc() = -89436590    // Thu Mar  2 00:00:00 UTC 1967
        gmtime() = -89596800    // Wed Mar  1 00:00:00 UTC 1967
    
    { .tm_mday = 1 .tm_mon = 2 .tm_year = 200 }
    mktime_utc() = 4107628800   // Tue Mar  2 00:00:00 UTC 2100
        gmtime() = 4107542400   // Mon Mar  1 00:00:00 UTC 2100
    
    Change-Id: I1a544762fa5178c8798496d7dc30a2e767919149
    Reviewed-on: https://code.wireshark.org/review/1287
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  8759da8   Improve LCAF handling
    adds  993adc8   Fix counting/ checking for leap years in mktime_utc()


Summary of changes:
 epan/tvbuff.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)