1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

More issues found by static analysis

This commit is contained in:
Maksim Shabunin
2018-07-24 14:14:13 +03:00
parent 8de08e0463
commit cbb1e867e5
27 changed files with 51 additions and 81 deletions
+4 -5
View File
@@ -123,7 +123,6 @@ static char* icvJSONParseKey( CvFileStorage* fs, char* ptr, CvFileNode* map, CvF
CV_PARSE_ERROR( "Key must start with \'\"\'" );
char * beg = ptr + 1;
char * end = beg;
do {
++ptr;
@@ -133,7 +132,7 @@ static char* icvJSONParseKey( CvFileStorage* fs, char* ptr, CvFileNode* map, CvF
if( *ptr != '"' )
CV_PARSE_ERROR( "Key must end with \'\"\'" );
end = ptr;
const char * end = ptr;
ptr++;
ptr = icvJSONSkipSpaces( fs, ptr );
if ( ptr == 0 || fs->dummy_eof )
@@ -576,12 +575,12 @@ void icvJSONParse( CvFileStorage* fs )
if ( *ptr == '{' )
{
CvFileNode* root_node = (CvFileNode*)cvSeqPush( fs->roots, 0 );
ptr = icvJSONParseMap( fs, ptr, root_node );
icvJSONParseMap( fs, ptr, root_node );
}
else if ( *ptr == '[' )
{
CvFileNode* root_node = (CvFileNode*)cvSeqPush( fs->roots, 0 );
ptr = icvJSONParseSeq( fs, ptr, root_node );
icvJSONParseSeq( fs, ptr, root_node );
}
else
{
@@ -668,7 +667,7 @@ void icvJSONWrite( CvFileStorage* fs, const char* key, const char* data )
*ptr++ = '\n';
*ptr++ = '\0';
::icvPuts( fs, fs->buffer_start );
ptr = fs->buffer = fs->buffer_start;
fs->buffer = fs->buffer_start;
}
ptr = icvFSFlush(fs);
}