diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-11-16 16:48:02 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-11-16 16:48:02 +0000 |
commit | 5ceeb22529993c55ec5f85e3e4d559b0c30e7630 (patch) | |
tree | 84fa6f58dcb7c2ceafbd7b37629a96130564f224 /wiretap | |
parent | 43bf2f8ba62e486aae603bf6c7093eeea67eb4e8 (diff) |
Another place where we have to protect against MSVC's time-conversion
routines blowing up if handed a too-large time_t.
svn path=/trunk/; revision=39882
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/k12text.l | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wiretap/k12text.l b/wiretap/k12text.l index 095652a752..914137394c 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -367,6 +367,14 @@ k12text_dump(wtap_dumper *wdh _U_, const struct wtap_pkthdr *phdr, if (phdr->pkt_encap == encaps[i].e) break; } +#ifdef _MSC_VER + /* calling gmtime() on MSVC 2005 with huge values causes it to crash */ + /* XXX - find the exact value that still does work */ + /* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */ + if (phdr.ts_secs > 2000000000) + strftime(p, 90, "+---------+---------------+----------+\r\nXX:XX:XX,"); + else +#endif strftime(p, 90, "+---------+---------------+----------+\r\n%H:%M:%S,", gmtime(&phdr->ts.secs)); wl = strlen(p); |