Mercurial > mxe-octave
comparison src/openscenegraph-3-no-asprintf.patch @ 916:2ae2b8ee4c18
replace asprintf in package openscenegraph
MinGW does not provide asprintf. We could get it from gnulib
or liberty, but in this case it's easy reimplement the section.
author | Mark Brand <mabrand@mabrand.nl> |
---|---|
date | Tue, 27 Apr 2010 12:33:40 +0200 |
parents | |
children | dec902a06078 |
comparison
equal
deleted
inserted
replaced
915:43389b74773e | 916:2ae2b8ee4c18 |
---|---|
1 This file is part of mingw-cross-env. | |
2 See doc/index.html for further information. | |
3 | |
4 diff -urN a/src/osgPlugins/xine/ReaderWriterXine.cpp b/src/osgPlugins/xine/ReaderWriterXine.cpp | |
5 --- a/src/osgPlugins/xine/ReaderWriterXine.cpp 2010-03-13 11:38:10.000000000 +0100 | |
6 +++ b/src/osgPlugins/xine/ReaderWriterXine.cpp 2010-04-27 12:21:20.597790305 +0200 | |
7 @@ -326,9 +326,15 @@ | |
8 const char* user_home = xine_get_homedir(); | |
9 if(user_home) | |
10 { | |
11 - char* cfgfile = NULL; | |
12 - int result = asprintf(&(cfgfile), "%s/.xine/config", user_home); | |
13 - if (result>0) xine_config_load(_xine, cfgfile); | |
14 + const char* tail = "/.xine/config"; | |
15 + int size = strlen(user_home) + strlen(tail) + 1; | |
16 + char* cfgfile = malloc(size); | |
17 + if (cfgfile) | |
18 + { | |
19 + strcpy(cfgfile, user_home); | |
20 + strcat(cfgfile, tail); | |
21 + xine_config_load(_xine, cfgfile); | |
22 + } | |
23 } | |
24 | |
25 xine_init(_xine); |