diff --git a/server/TracyStorage.cpp b/server/TracyStorage.cpp index e2a5d1bd..1e10f166 100644 --- a/server/TracyStorage.cpp +++ b/server/TracyStorage.cpp @@ -127,8 +127,64 @@ const char* GetSavePath( const char* program, uint64_t time, const char* file, b size_t sz; GetConfigDirectory( buf, sz ); + const auto psz = strlen( program ); + assert( psz < 512 ); + char tmp[512]; + strcpy( tmp, program ); + for( size_t i=0; i': + case ':': + case '"': + case '/': + case '\\': + case '|': + case '?': + case '*': + tmp[i] = '_'; + break; + default: + break; + } + } + // 604800 = 7 days - sz += sprintf( buf+sz, "/tracy/user/%c/%s/%" PRIu64 "/%" PRIu64 "/", program[0], program, uint64_t( time / 604800 ), time ); + sz += sprintf( buf+sz, "/tracy/user/%c/%s/%" PRIu64 "/%" PRIu64 "/", tmp[0], tmp, uint64_t( time / 604800 ), time ); if( create ) {