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

persistence: fixing crash with space-only values

This commit is contained in:
Philipp Hasper
2016-07-07 09:55:30 +02:00
parent 22682f933a
commit 00112bbe10
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -1852,7 +1852,7 @@ icvYMLWriteString( CvFileStorage* fs, const char* key,
if( quote || len == 0 || str[0] != str[len-1] || (str[0] != '\"' && str[0] != '\'') )
{
int need_quote = quote || len == 0;
int need_quote = quote || len == 0 || str[0] == ' ';
data = buf;
*data++ = '\"';
for( i = 0; i < len; i++ )