Ticket #5693: programs_mythfilldatabase-uninit-ticket-5693.patch

File programs_mythfilldatabase-uninit-ticket-5693.patch, 1.1 KB (added by Erik Hovland <erik@…>, 12 years ago)

changes the initialization to conform to danielk's suggestion

  • mythtv/programs/mythfilldatabase/filldata.cpp

    Defects where a variable might be used uninitialized.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythtv/programs/mythfilldatabase/filldata.cpp |    8 ++++++++
     1 files changed, 8 insertions(+), 0 deletions(-)
    
    
    diff --git a/mythtv/programs/mythfilldatabase/filldata.cpp b/mythtv/programs/mythfilldatabase/filldata.cpp
    index 7fd5954..0a523dc 100644
    a b time_t toTime_t(QDateTime &dt) 
    305305    brokenDown.tm_mday = dt.date().day();
    306306    brokenDown.tm_mon = dt.date().month() - 1;
    307307    brokenDown.tm_year = dt.date().year() - 1900;
     308    brokenDown.tm_wday = dt.date().dayOfWeek() - 1;
     309    brokenDown.tm_yday = dt.date().dayOfYear() - 1;
    308310    brokenDown.tm_isdst = -1;
     311#if defined(__GLIBC__)
     312    // glibc has a couple of extra additional fields
     313    ::tzset();
     314    brokenDown.tm_gmtoff = 0;
     315    brokenDown.tm_zone = (const char*) NULL;
     316#endif
    309317    int secsSince1Jan1970UTC = (int) mktime( &brokenDown );
    310318    if ( secsSince1Jan1970UTC < -1 )
    311319        secsSince1Jan1970UTC = -1;