mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Use strlen instead of pointer walking in the rest of places.
This commit is contained in:
parent
9f0f3a7218
commit
be40c1e38e
@ -901,8 +901,7 @@ char* NormalizePath( const char* path )
|
|||||||
if( path[0] != '/' ) return nullptr;
|
if( path[0] != '/' ) return nullptr;
|
||||||
|
|
||||||
const char* ptr = path;
|
const char* ptr = path;
|
||||||
const char* end = path;
|
const char* end = path + strlen( path );
|
||||||
while( *end ) end++;
|
|
||||||
|
|
||||||
char* res = (char*)tracy_malloc( end - ptr + 1 );
|
char* res = (char*)tracy_malloc( end - ptr + 1 );
|
||||||
size_t rsz = 0;
|
size_t rsz = 0;
|
||||||
|
@ -3638,14 +3638,12 @@ void Worker::AddSourceLocationPayload( const char* data, size_t sz )
|
|||||||
memcpy( &color, data, 4 );
|
memcpy( &color, data, 4 );
|
||||||
memcpy( &line, data + 4, 4 );
|
memcpy( &line, data + 4, 4 );
|
||||||
data += 8;
|
data += 8;
|
||||||
auto end = data;
|
auto end = data + strlen( data );
|
||||||
|
|
||||||
while( *end ) end++;
|
|
||||||
const auto func = StoreString( data, end - data );
|
const auto func = StoreString( data, end - data );
|
||||||
end++;
|
end++;
|
||||||
|
|
||||||
data = end;
|
data = end + strlen( data );
|
||||||
while( *end ) end++;
|
|
||||||
const auto source = StoreString( data, end - data );
|
const auto source = StoreString( data, end - data );
|
||||||
end++;
|
end++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user