diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-12-08 07:41:43 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-12-08 07:41:43 +0000 |
commit | 62c3372576727d699c52595de0f8a6a7673740c3 (patch) | |
tree | 400abceefb17e19d5f03950f933e1d8a8cd8e1c4 /epan/dissectors/packet-dtn.c | |
parent | c70da4bd10afb01c56bc3280085a5b6b9bbd6e7b (diff) | |
download | wireshark-62c3372576727d699c52595de0f8a6a7673740c3.tar.gz |
From Jakub Zawadzki:
ctime() is not thread safe and it's obsolete.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4302
svn path=/trunk/; revision=31200
Diffstat (limited to 'epan/dissectors/packet-dtn.c')
-rw-r--r-- | epan/dissectors/packet-dtn.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/epan/dissectors/packet-dtn.c b/epan/dissectors/packet-dtn.c index 9799de9dbb..6d8dd5026c 100644 --- a/epan/dissectors/packet-dtn.c +++ b/epan/dissectors/packet-dtn.c @@ -1286,8 +1286,7 @@ dissect_version_5_primary_header(packet_info *pinfo, return 0; } time_since_2000 = (time_t) (timestamp + 946684800); - time_string = ctime(&time_since_2000); - time_string[strlen(time_string) - 1] = 0; /*Remove Newline at enc*/ + time_string = abs_time_secs_to_str(time_since_2000); proto_item_set_text(timestamp_item, "Timestamp: 0x%x [%s]", timestamp, time_string); offset += sdnv_length; @@ -2094,8 +2093,7 @@ add_dtn_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, char *field_id return 0; } time_since_2000 = (time_t) (sdnv_value + 946684800); - time_string = ctime(&time_since_2000); - time_string[strlen(time_string) - 1] = 0; /*Remove Newline at enc*/ + time_string = abs_time_secs_to_str(time_since_2000); proto_tree_add_text(tree, tvb, offset, sdnv_length, "%s (sec): %d [%s]", field_id, sdnv_value, time_string); offset += sdnv_length; @@ -2126,8 +2124,7 @@ add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, char *field_i return 0; } time_since_2000 = (time_t) (sdnv_value + 946684800); - time_string = ctime(&time_since_2000); - time_string[strlen(time_string) - 1] = 0; /*Remove Newline at enc*/ + time_string = abs_time_secs_to_str(time_since_2000); proto_tree_add_text(tree, tvb, offset, sdnv_length, "%s: %d [%s]", field_id, sdnv_value, time_string); return sdnv_length; |