diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-05-31 06:48:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-05-31 06:48:00 +0000 |
commit | 52025d69565657ebe1065c2ed74fe7811aee0dda (patch) | |
tree | b6f6edbff0b1611ecee3c4fcd13e84a303469075 /epan/to_str.c | |
parent | 15336e821c21b86ffa8a31d4049e25a6b2472987 (diff) |
Display all the digits of the microsecond field of an absolute time
value.
Check that the microseconds field of an absolute time is valid, if it's
present.
Set "tm_isdst" in the "struct tm" handed to "mktime()" to -1, so that
"mktime()" will attempt to figure out whether the time is daylight
savings time or not.
Check that "mktime()" was able to convert the time.
svn path=/trunk/; revision=3487
Diffstat (limited to 'epan/to_str.c')
-rw-r--r-- | epan/to_str.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/to_str.c b/epan/to_str.c index be282e1c1b..b40628bff8 100644 --- a/epan/to_str.c +++ b/epan/to_str.c @@ -1,7 +1,7 @@ /* to_str.h * Routines for utilities to convert various other types to strings. * - * $Id: to_str.c,v 1.7 2001/05/28 20:12:30 guy Exp $ + * $Id: to_str.c,v 1.8 2001/05/31 06:47:59 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -340,7 +340,7 @@ abs_time_to_str(struct timeval *abs_time) { struct tm *tmp; static gchar *cur; - static char str[3][3+1+2+2+4+1+2+1+2+1+2+1+4+1 + 5 /* extra */]; + static char str[3][3+1+2+2+4+1+2+1+2+1+2+1+6+1 + 5 /* extra */]; if (cur == &str[0][0]) { cur = &str[1][0]; @@ -351,14 +351,14 @@ abs_time_to_str(struct timeval *abs_time) } tmp = localtime(&abs_time->tv_sec); - sprintf(cur, "%s %2d, %d %02d:%02d:%02d.%04ld", + sprintf(cur, "%s %2d, %d %02d:%02d:%02d.%06ld", mon_names[tmp->tm_mon], tmp->tm_mday, tmp->tm_year + 1900, tmp->tm_hour, tmp->tm_min, tmp->tm_sec, - (long)abs_time->tv_usec/100); + (long)abs_time->tv_usec); return cur; } |