diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2007-11-26 08:08:51 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2007-11-26 08:08:51 +0000 |
commit | b19c9f164e2cc70ea20c34f7a14e4b43abe59b83 (patch) | |
tree | a334c217bc5d855f32bcc5af5fad782dea96647d | |
parent | 91cd7ec475ea734795e5bfcc03d6c6c1dc916586 (diff) |
Change %G to %Y for year in strftime() so it works on Windows also (%G is an extension found at least on OS X). Also change from 4 to 5 bytes in each strftime() to allow space for the NULL terminator with 4 character outputs.
svn path=/trunk/; revision=23595
-rw-r--r-- | wiretap/commview.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/commview.c b/wiretap/commview.c index 8c4121689f..bb48fef918 100644 --- a/wiretap/commview.c +++ b/wiretap/commview.c @@ -315,22 +315,22 @@ static gboolean commview_dump(wtap_dumper *wdh, cv_hdr.source_data_len = GUINT16_TO_LE((guint16)phdr->caplen); cv_hdr.version = 0; - strftime(date_time, 4, "%G", localtime(&phdr->ts.secs)); + strftime(date_time, 5, "%Y", localtime(&phdr->ts.secs)); cv_hdr.year = GUINT16_TO_LE((guint16)strtol(date_time, NULL, 10)); - strftime(date_time, 4, "%m", localtime(&phdr->ts.secs)); + strftime(date_time, 5, "%m", localtime(&phdr->ts.secs)); cv_hdr.month = (guint8)strtol(date_time, NULL, 10); - strftime(date_time, 4, "%d", localtime(&phdr->ts.secs)); + strftime(date_time, 5, "%d", localtime(&phdr->ts.secs)); cv_hdr.day = (guint8)strtol(date_time, NULL, 10); - strftime(date_time, 4, "%H", localtime(&phdr->ts.secs)); + strftime(date_time, 5, "%H", localtime(&phdr->ts.secs)); cv_hdr.hours = (guint8)strtol(date_time, NULL, 10); - strftime(date_time, 4, "%M", localtime(&phdr->ts.secs)); + strftime(date_time, 5, "%M", localtime(&phdr->ts.secs)); cv_hdr.minutes = (guint8)strtol(date_time, NULL, 10); - strftime(date_time, 4, "%S", localtime(&phdr->ts.secs)); + strftime(date_time, 5, "%S", localtime(&phdr->ts.secs)); cv_hdr.seconds = (guint8)strtol(date_time, NULL, 10); cv_hdr.usecs = GUINT32_TO_LE(phdr->ts.nsecs / 1000); |