Don't assign const char ptr to char ptr.

This commit is contained in:
Bartosz Taudul 2018-06-20 20:35:57 +02:00
parent 6c9add0f30
commit 45cec65eef

View File

@ -73,22 +73,24 @@ CallstackEntry DecodeCallstackPtr( uint64_t ptr )
ret.name = name; ret.name = name;
const char* filename;
IMAGEHLP_LINE64 line; IMAGEHLP_LINE64 line;
unsigned long displacement = 0; unsigned long displacement = 0;
line.SizeOfStruct = sizeof( IMAGEHLP_LINE64 ); line.SizeOfStruct = sizeof( IMAGEHLP_LINE64 );
if( SymGetLineFromAddr64( proc, ptr, &displacement, &line ) == 0 ) if( SymGetLineFromAddr64( proc, ptr, &displacement, &line ) == 0 )
{ {
line.FileName = "[unknown]"; filename = "[unknown]";
ret.line = 0; ret.line = 0;
} }
else else
{ {
filename = line.FileName;
ret.line = line.LineNumber; ret.line = line.LineNumber;
} }
const auto fsz = strlen( line.FileName ); const auto fsz = strlen( filename );
auto file = (char*)tracy_malloc( fsz + 1 ); auto file = (char*)tracy_malloc( fsz + 1 );
memcpy( file, line.FileName, fsz ); memcpy( file, filename, fsz );
file[fsz] = '\0'; file[fsz] = '\0';
ret.file = file; ret.file = file;