Commit fdcfe31d authored by Sylvain Thery's avatar Sylvain Thery

non standard c++ allocation

parent 1e81fb2a
...@@ -197,7 +197,8 @@ void Image<DataType>::loadVox(const char *filename) ...@@ -197,7 +197,8 @@ void Image<DataType>::loadVox(const char *filename)
m_Data = new DataType[total]; m_Data = new DataType[total];
int filename_s = strlen(filename) ; int filename_s = strlen(filename) ;
char datafile[filename_s] ; // char datafile[filename_s] ;
char* datafile = new char[filename_s] ;
strcpy(datafile, filename) ; strcpy(datafile, filename) ;
datafile[filename_s-3] = 'r' ; datafile[filename_s-3] = 'r' ;
datafile[filename_s-2] = 'a' ; datafile[filename_s-2] = 'a' ;
...@@ -207,6 +208,7 @@ void Image<DataType>::loadVox(const char *filename) ...@@ -207,6 +208,7 @@ void Image<DataType>::loadVox(const char *filename)
fp.read(reinterpret_cast<char*>(m_Data), total*sizeof(DataType)); fp.read(reinterpret_cast<char*>(m_Data), total*sizeof(DataType));
m_Alloc=true; m_Alloc=true;
delete[] datafile;
} }
#ifdef WITH_QT #ifdef WITH_QT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment