@ -911,17 +911,17 @@ int ImStricmp(const char* str1, const char* str2)
return d ;
}
int ImStrnicmp ( const char * str1 , const char * str2 , in t count )
int ImStrnicmp ( const char * str1 , const char * str2 , size_ t count )
{
int d = 0 ;
while ( count > 0 & & ( d = toupper ( * str2 ) - toupper ( * str1 ) ) = = 0 & & * str1 ) { str1 + + ; str2 + + ; count - - ; }
return d ;
}
void ImStrncpy ( char * dst , const char * src , in t count )
void ImStrncpy ( char * dst , const char * src , size_ t count )
{
if ( count < 1 ) return ;
strncpy ( dst , src , ( size_t ) count ) ;
strncpy ( dst , src , count ) ;
dst [ count - 1 ] = 0 ;
}
@ -992,7 +992,7 @@ static const char* ImAtoi(const char* src, int* output)
// Ideally we would test for only one of those limits at runtime depending on the behavior the vsnprintf(), but trying to deduct it at compile time sounds like a pandora can of worm.
// B) When buf==NULL vsnprintf() will return the output size.
# ifndef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
int ImFormatString ( char * buf , in t buf_size , const char * fmt , . . . )
int ImFormatString ( char * buf , size_ t buf_size , const char * fmt , . . . )
{
va_list args ;
va_start ( args , fmt ) ;
@ -1000,19 +1000,19 @@ int ImFormatString(char* buf, int buf_size, const char* fmt, ...)
va_end ( args ) ;
if ( buf = = NULL )
return w ;
if ( w = = - 1 | | w > = buf_size )
w = buf_size - 1 ;
if ( w = = - 1 | | w > = ( int ) buf_size )
w = ( int ) buf_size - 1 ;
buf [ w ] = 0 ;
return w ;
}
int ImFormatStringV ( char * buf , in t buf_size , const char * fmt , va_list args )
int ImFormatStringV ( char * buf , size_ t buf_size , const char * fmt , va_list args )
{
int w = vsnprintf ( buf , buf_size , fmt , args ) ;
if ( buf = = NULL )
return w ;
if ( w = = - 1 | | w > = buf_size )
w = buf_size - 1 ;
if ( w = = - 1 | | w > = ( int ) buf_size )
w = ( int ) buf_size - 1 ;
buf [ w ] = 0 ;
return w ;
}