mirror of https://git.wownero.com/dsc/mxe.git
upstream version of no-asprintf patch for package openscenegraph
Upstream liked the idea, but they also like std::string and took the opporunity to fix the memory leak.
This commit is contained in:
parent
5086294801
commit
b1a6395a96
|
@ -3,23 +3,16 @@ See doc/index.html for further information.
|
||||||
|
|
||||||
diff -urN a/src/osgPlugins/xine/ReaderWriterXine.cpp b/src/osgPlugins/xine/ReaderWriterXine.cpp
|
diff -urN a/src/osgPlugins/xine/ReaderWriterXine.cpp b/src/osgPlugins/xine/ReaderWriterXine.cpp
|
||||||
--- a/src/osgPlugins/xine/ReaderWriterXine.cpp 2010-03-13 11:38:10.000000000 +0100
|
--- a/src/osgPlugins/xine/ReaderWriterXine.cpp 2010-03-13 11:38:10.000000000 +0100
|
||||||
+++ b/src/osgPlugins/xine/ReaderWriterXine.cpp 2010-04-27 12:21:20.597790305 +0200
|
+++ b/src/osgPlugins/xine/ReaderWriterXine.cpp 2010-04-28 22:54:29.203481468 +0200
|
||||||
@@ -326,9 +326,15 @@
|
@@ -326,9 +326,8 @@
|
||||||
const char* user_home = xine_get_homedir();
|
const char* user_home = xine_get_homedir();
|
||||||
if(user_home)
|
if(user_home)
|
||||||
{
|
{
|
||||||
- char* cfgfile = NULL;
|
- char* cfgfile = NULL;
|
||||||
- int result = asprintf(&(cfgfile), "%s/.xine/config", user_home);
|
- int result = asprintf(&(cfgfile), "%s/.xine/config", user_home);
|
||||||
- if (result>0) xine_config_load(_xine, cfgfile);
|
- if (result>0) xine_config_load(_xine, cfgfile);
|
||||||
+ const char* tail = "/.xine/config";
|
+ std::string configFile(std::string(user_home)+"/.xine/config");
|
||||||
+ int size = strlen(user_home) + strlen(tail) + 1;
|
+ xine_config_load(_xine, configFile.c_str());
|
||||||
+ char* cfgfile = malloc(size);
|
|
||||||
+ if (cfgfile)
|
|
||||||
+ {
|
|
||||||
+ strcpy(cfgfile, user_home);
|
|
||||||
+ strcat(cfgfile, tail);
|
|
||||||
+ xine_config_load(_xine, cfgfile);
|
|
||||||
+ }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xine_init(_xine);
|
xine_init(_xine);
|
||||||
|
|
Loading…
Reference in New Issue