aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipmi.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-12-10 20:48:31 +0000
committerGuy Harris <guy@alum.mit.edu>2009-12-10 20:48:31 +0000
commit9a4bdbf9ea2d96084f9e8c2e95d45d92cdc953ec (patch)
treea5a03a5e5c5cbd20e97e11dd32e8157828b44b2b /epan/dissectors/packet-ipmi.c
parent4bc9b95d69fade853c5c0b00ba7720e1b01a85bc (diff)
Use existing code to format relative and absolute times.
svn path=/trunk/; revision=31224
Diffstat (limited to 'epan/dissectors/packet-ipmi.c')
-rw-r--r--epan/dissectors/packet-ipmi.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c
index 6ddb109e6e..d60554a230 100644
--- a/epan/dissectors/packet-ipmi.c
+++ b/epan/dissectors/packet-ipmi.c
@@ -771,27 +771,17 @@ void
ipmi_add_timestamp(proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset)
{
guint32 ts = tvb_get_letohl(tvb, offset);
- guint32 d, h, m, s;
- char buf[64];
if (ts == 0xffffffff) {
proto_tree_add_uint_format_value(tree, hf, tvb, offset, 4,
ts, "Unspecified/Invalid");
} else if (ts <= 0x20000000) {
- s = ts % 60;
- m = ts / 60;
- h = m / 60;
- m %= 60;
- d = h / 24;
- h %= 24;
proto_tree_add_uint_format_value(tree, hf, tvb, offset, 4,
- ts, "%d days, %02d:%02d:%02d since SEL device's initialization",
- d, h, m, s);
+ ts, "%s since SEL device's initialization",
+ time_secs_to_str_unsigned(ts));
} else {
- time_t t = ts;
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", gmtime(&t));
proto_tree_add_uint_format_value(tree, hf, tvb, offset, 4,
- ts, "%s", buf);
+ ts, "%s", abs_time_secs_to_str(ts));
}
}