Fix cppcheck reports warnings:
(performance) Possible inefficient checking for 'lmap' emptiness (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? (style) Array index '<xxx>' is used before limits check
This commit is contained in:
@@ -192,7 +192,7 @@ static ImageEncoder findEncoder( const String& _ext )
|
||||
if( !ext )
|
||||
return ImageEncoder();
|
||||
int len = 0;
|
||||
for( ext++; isalnum(ext[len]) && len < 128; len++ )
|
||||
for( ext++; len < 128 && isalnum(ext[len]); len++ )
|
||||
;
|
||||
|
||||
for( size_t i = 0; i < codecs.encoders.size(); i++ )
|
||||
@@ -206,7 +206,7 @@ static ImageEncoder findEncoder( const String& _ext )
|
||||
if( !descr )
|
||||
break;
|
||||
int j = 0;
|
||||
for( descr++; isalnum(descr[j]) && j < len; j++ )
|
||||
for( descr++; j < len && isalnum(descr[j]) ; j++ )
|
||||
{
|
||||
int c1 = tolower(ext[j]);
|
||||
int c2 = tolower(descr[j]);
|
||||
|
Reference in New Issue
Block a user