summaryrefslogtreecommitdiff
path: root/epan/plugins.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-12-31 00:32:00 +0000
committerGuy Harris <guy@alum.mit.edu>2004-12-31 00:32:00 +0000
commit4c0f806dc98d731bd05f85f9e9e90de35e9f32f4 (patch)
tree3ac901453a8bbf55f356570ce1f504625f33624b /epan/plugins.c
parent1d182e4fcc37b97ebc379c7255f24b4dd49412ed (diff)
downloadwireshark-4c0f806dc98d731bd05f85f9e9e90de35e9f32f4.tar.gz
As "get_persconffile_path()" doesn't return a "const char *", neither
does "get_plugins_pers_dir()" - and "get_plugins_global_dir()" doesn't return one either. Both of them return mallocated data, and making them return a "const char *" just causes compiler whining when you try to free them. svn path=/trunk/; revision=12883
Diffstat (limited to 'epan/plugins.c')
-rw-r--r--epan/plugins.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/plugins.c b/epan/plugins.c
index 79a4306fe1..c2edfda9b3 100644
--- a/epan/plugins.c
+++ b/epan/plugins.c
@@ -313,7 +313,7 @@ plugins_scan_dir(const char *dirname)
/* get the global plugin dir */
/* Return value is malloced so the caller should g_free() it. */
-const char *get_plugins_global_dir(const char *plugin_dir)
+char *get_plugins_global_dir(const char *plugin_dir)
{
#ifdef _WIN32
char *install_plugin_dir;
@@ -365,7 +365,7 @@ const char *get_plugins_global_dir(const char *plugin_dir)
/* get the personal plugin dir */
/* Return value is malloced so the caller should g_free() it. */
-const char *get_plugins_pers_dir(void)
+char *get_plugins_pers_dir(void)
{
return get_persconffile_path(PLUGINS_DIR_NAME, FALSE);
}
@@ -376,7 +376,7 @@ const char *get_plugins_pers_dir(void)
void
init_plugins(const char *plugin_dir)
{
- const char *datafile_dir;
+ char *datafile_dir;
if (plugin_list == NULL) /* ensure init_plugins is only run once */
{
@@ -385,14 +385,14 @@ init_plugins(const char *plugin_dir)
*/
datafile_dir = get_plugins_global_dir(plugin_dir);
plugins_scan_dir(datafile_dir);
- g_free((char *) datafile_dir);
+ g_free(datafile_dir);
/*
* Scan the users plugin directory.
*/
datafile_dir = get_plugins_pers_dir();
plugins_scan_dir(datafile_dir);
- g_free((char *) datafile_dir);
+ g_free(datafile_dir);
}
}