mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +00:00
Verify tiny int printing input.
This commit is contained in:
parent
182efc0b04
commit
b418c55e89
@ -32,6 +32,7 @@ static const char* IntTable100 =
|
|||||||
|
|
||||||
static inline void PrintTinyInt( char*& buf, uint64_t v )
|
static inline void PrintTinyInt( char*& buf, uint64_t v )
|
||||||
{
|
{
|
||||||
|
assert( v < 100 );
|
||||||
if( v >= 10 )
|
if( v >= 10 )
|
||||||
{
|
{
|
||||||
*buf++ = '0' + v/10;
|
*buf++ = '0' + v/10;
|
||||||
@ -41,6 +42,7 @@ static inline void PrintTinyInt( char*& buf, uint64_t v )
|
|||||||
|
|
||||||
static inline void PrintTinyInt0( char*& buf, uint64_t v )
|
static inline void PrintTinyInt0( char*& buf, uint64_t v )
|
||||||
{
|
{
|
||||||
|
assert( v < 100 );
|
||||||
if( v >= 10 )
|
if( v >= 10 )
|
||||||
{
|
{
|
||||||
*buf++ = '0' + v/10;
|
*buf++ = '0' + v/10;
|
||||||
@ -54,6 +56,7 @@ static inline void PrintTinyInt0( char*& buf, uint64_t v )
|
|||||||
|
|
||||||
static inline void PrintSmallInt( char*& buf, uint64_t v )
|
static inline void PrintSmallInt( char*& buf, uint64_t v )
|
||||||
{
|
{
|
||||||
|
assert( v < 1000 );
|
||||||
if( v >= 100 )
|
if( v >= 100 )
|
||||||
{
|
{
|
||||||
memcpy( buf, IntTable100 + v/10*2, 2 );
|
memcpy( buf, IntTable100 + v/10*2, 2 );
|
||||||
|
Loading…
Reference in New Issue
Block a user