提交 1da8a19a 编写于 作者: M MYLS

fixed two bugs that I caused.

上级 86238d27
......@@ -1176,13 +1176,13 @@ static void check_if_write_struct_is_delayed( CvFileStorage* fs, bool change_typ
std::string type_name;
int struct_flags = fs->delayed_struct_flags;
if ( fs->delayed_struct_key != 0 && *fs->delayed_type_name != '\0' )
if ( fs->delayed_struct_key != 0 && *fs->delayed_struct_key != '\0' )
{
struct_key.assign(fs->delayed_struct_key);
}
if ( fs->delayed_type_name != 0 && *fs->delayed_type_name != '\0' )
{
struct_key.assign(fs->delayed_type_name);
type_name.assign(fs->delayed_type_name);
}
/* reset */
......@@ -1949,6 +1949,9 @@ icvYMLStartWriteStruct( CvFileStorage* fs, const char* key, int struct_flags,
char buf[CV_FS_MAX_LEN + 1024];
const char* data = 0;
if ( type_name && *type_name == '\0' )
type_name = 0;
struct_flags = (struct_flags & (CV_NODE_TYPE_MASK|CV_NODE_FLOW)) | CV_NODE_EMPTY;
if( !CV_NODE_IS_COLLECTION(struct_flags))
CV_Error( CV_StsBadArg,
......@@ -2914,6 +2917,9 @@ icvXMLStartWriteStruct( CvFileStorage* fs, const char* key, int struct_flags,
CV_Error( CV_StsBadArg,
"Some collection type: CV_NODE_SEQ or CV_NODE_MAP must be specified" );
if ( type_name && *type_name == '\0' )
type_name = 0;
if( type_name )
{
attr[idx++] = "type_id";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册