1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

User data directory location getter.

This commit is contained in:
Bartosz Taudul
2019-12-28 18:16:45 +01:00
parent 36942a5ddb
commit 9e76ddb9fd
3 changed files with 18 additions and 4 deletions
+10 -4
View File
@@ -117,7 +117,6 @@ const char* GetSavePath( const char* file )
const char* GetSavePath( const char* program, uint64_t time, const char* file, bool create )
{
assert( file && *file );
assert( program && *program );
enum { Pool = 8 };
@@ -195,9 +194,16 @@ const char* GetSavePath( const char* program, uint64_t time, const char* file, b
assert( status );
}
const auto fsz = strlen( file );
assert( sz + fsz < MaxPath );
memcpy( buf+sz, file, fsz+1 );
if( file )
{
const auto fsz = strlen( file );
assert( sz + fsz < MaxPath );
memcpy( buf+sz, file, fsz+1 );
}
else
{
buf[sz] = '\0';
}
return buf;
}