summaryrefslogtreecommitdiff
path: root/wiretap/network_instruments.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-02-03 15:38:20 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-02-03 15:38:20 +0000
commit47d744b59da83744623bea39c006eb7e2ec02de9 (patch)
tree17d9ec1526a37c793ee3d7cbd031091d1867dd7f /wiretap/network_instruments.c
parente59b5d6b8a963263b0c2dcf163e07b4318737d71 (diff)
downloadwireshark-47d744b59da83744623bea39c006eb7e2ec02de9.tar.gz
More rewrite of prohibited APIs (sprintf, strcpy, strcat).
svn path=/trunk/; revision=24258
Diffstat (limited to 'wiretap/network_instruments.c')
-rw-r--r--wiretap/network_instruments.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/network_instruments.c b/wiretap/network_instruments.c
index c36611ec3a..9686737732 100644
--- a/wiretap/network_instruments.c
+++ b/wiretap/network_instruments.c
@@ -490,7 +490,7 @@ gboolean network_instruments_dump_open(wtap_dumper *wdh, gboolean cant_seek, int
time(&system_time);
current_time = localtime(&system_time);
memset(&comment, 0x00, sizeof(comment));
- sprintf(comment, "This capture was saved from Wireshark on %s", asctime(current_time));
+ g_snprintf(comment, 64, "This capture was saved from Wireshark on %s", asctime(current_time));
/* create the file header */
if (fseek(wdh->fh, 0, SEEK_SET) == -1) {
@@ -498,7 +498,7 @@ gboolean network_instruments_dump_open(wtap_dumper *wdh, gboolean cant_seek, int
return FALSE;
}
memset(&file_header, 0x00, sizeof(capture_file_header));
- strcpy(file_header.observer_version, network_instruments_magic);
+ strncpy(file_header.observer_version, network_instruments_magic, 32);
file_header.offset_to_first_packet = sizeof(capture_file_header) + sizeof(tlv_header) + strlen(comment);
file_header.offset_to_first_packet = GUINT16_TO_LE(file_header.offset_to_first_packet);
file_header.number_of_information_elements = 1;