aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tpncp.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2010-01-02 09:46:16 +0000
committerAnders Broman <anders.broman@ericsson.com>2010-01-02 09:46:16 +0000
commit7afd9b0c3b6a16397291a64293d547b46f502669 (patch)
tree51df04c46d2ad1c10a02b1d69ae7162ac8365825 /epan/dissectors/packet-tpncp.c
parent02a69c193522d69060008add5b7b77387dad123d (diff)
From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164 svn path=/trunk/; revision=31408
Diffstat (limited to 'epan/dissectors/packet-tpncp.c')
-rw-r--r--epan/dissectors/packet-tpncp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c
index e8426c16d0..a1200dfdf3 100644
--- a/epan/dissectors/packet-tpncp.c
+++ b/epan/dissectors/packet-tpncp.c
@@ -54,7 +54,6 @@
#define UDP_PORT_TPNCP_HOST BASE_TPNCP_PORT
#define BASE_TPNCP_DATA_LEN 256
-#define MAX_TPNCP_DAT_FILE_PATH_LEN BASE_TPNCP_DATA_LEN
#define MAX_TPNCP_DB_ENTRY_LEN BASE_TPNCP_DATA_LEN
#define MAX_TPNCP_DB_SIZE 3000
@@ -682,12 +681,10 @@ static gint init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info,
/*-------------------------------------------------------------------------------------------------------------------------------------------*/
static gint init_tpncp_db(void) {
- gchar *tpncp_dat_file_path = NULL;
- FILE *file = NULL;
+ gchar *tpncp_dat_file_path;
+ FILE *file;
- tpncp_dat_file_path = ep_alloc(MAX_TPNCP_DAT_FILE_PATH_LEN);
- tpncp_dat_file_path[0] = 0;
- g_snprintf(tpncp_dat_file_path, MAX_TPNCP_DAT_FILE_PATH_LEN, "%s" G_DIR_SEPARATOR_S"tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir());
+ tpncp_dat_file_path = ep_strdup_printf("%s" G_DIR_SEPARATOR_S"tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir());
/* Open file with TPNCP data. */
if ((file = ws_fopen(tpncp_dat_file_path, "r")) == NULL)