From b19c9f164e2cc70ea20c34f7a14e4b43abe59b83 Mon Sep 17 00:00:00 2001 From: Stephen Fisher Date: Mon, 26 Nov 2007 08:08:51 +0000 Subject: [PATCH] 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 --- wiretap/commview.c | 12 ++++++------ 1 file 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);