Ticket #154: sm-mod_iq_time.diff

File sm-mod_iq_time.diff, 0.7 KB (added by mm, 16 months ago)

Patch proposal for sm/mod_iq_time.c

  • sm/mod_iq_time.c

    old new  
    7878    datetime_out(t, dt_DATETIME, buf, 64); 
    7979    nad_insert_elem(pkt->nad, 2, NAD_ENS(pkt->nad, 1), "utc", buf); 
    8080 
    81     snprintf(buf, 64, "%+03d:%02d", (int) -timezone/(60*60), (int) -timezone%(60*60)); 
     81#ifdef HAVE_TZSET 
     82    snprintf(buf, 64, "%c%02d:%02d", timezone < 0 ? '-' : '+', (int) timezone/(60*60), (int) timezone%(60*60)); 
     83#else 
     84    snprintf(buf, 64, "%c%02d:%02d", tm->tm_gmtoff < 0 ? '-' : '+', (int) tm->tm_gmtoff/(60*60), (int) tm->tm_gmtoff%(60*60)); 
     85#endif 
    8286    nad_insert_elem(pkt->nad, 2, NAD_ENS(pkt->nad, 1), "tzo", buf); 
    8387 
    8488#ifdef ENABLE_SUPERSEDED