@@ -114,7 +114,8 @@ InitConfigFileParser::parseConfig(FILE * file) {
114
114
" of configuration file." );
115
115
return 0 ;
116
116
}
117
- BaseString::snprintf (ctx.fname , sizeof (ctx.fname ), section); free (section);
117
+ BaseString::snprintf (ctx.fname , sizeof (ctx.fname ), " %s" , section);
118
+ free (section);
118
119
ctx.type = InitConfigFileParser::DefaultSection;
119
120
ctx.m_sectionLineno = ctx.m_lineno ;
120
121
ctx.m_currentSection = new Properties (true );
@@ -134,7 +135,7 @@ InitConfigFileParser::parseConfig(FILE * file) {
134
135
" of configuration file." );
135
136
return 0 ;
136
137
}
137
- BaseString::snprintf (ctx.fname , sizeof (ctx.fname ), section);
138
+ BaseString::snprintf (ctx.fname , sizeof (ctx.fname ), " %s " , section);
138
139
free (section);
139
140
ctx.type = InitConfigFileParser::Section;
140
141
ctx.m_sectionLineno = ctx.m_lineno ;
@@ -184,7 +185,8 @@ InitConfigFileParser::run_config_rules(Context& ctx)
184
185
return 0 ;
185
186
186
187
for (size_t j = 0 ; j<tmp.size (); j++){
187
- BaseString::snprintf (ctx.fname , sizeof (ctx.fname ), tmp[j].m_sectionType .c_str ());
188
+ BaseString::snprintf (ctx.fname , sizeof (ctx.fname ),
189
+ " %s" , tmp[j].m_sectionType .c_str ());
188
190
ctx.type = InitConfigFileParser::Section;
189
191
ctx.m_currentSection = tmp[j].m_sectionData ;
190
192
ctx.m_userDefaults = getSection (ctx.fname , ctx.m_defaults );
@@ -560,13 +562,15 @@ InitConfigFileParser::storeSection(Context& ctx){
560
562
for (int i = strlen (ctx.fname ) - 1 ; i>=0 ; i--){
561
563
ctx.fname [i] = toupper (ctx.fname [i]);
562
564
}
563
- BaseString::snprintf (ctx.pname , sizeof (ctx.pname ), ctx.fname );
565
+ BaseString::snprintf (ctx.pname , sizeof (ctx.pname ), " %s" , ctx.fname );
566
+
564
567
char buf[255 ];
565
568
if (ctx.type == InitConfigFileParser::Section)
566
569
BaseString::snprintf (buf, sizeof (buf), " %s" , ctx.fname );
567
570
if (ctx.type == InitConfigFileParser::DefaultSection)
568
571
BaseString::snprintf (buf, sizeof (buf), " %s DEFAULT" , ctx.fname );
569
- BaseString::snprintf (ctx.fname , sizeof (ctx.fname ), buf);
572
+ BaseString::snprintf (ctx.fname , sizeof (ctx.fname ), " %s" , buf);
573
+
570
574
if (ctx.type == InitConfigFileParser::Section){
571
575
for (int i = 0 ; i<m_info->m_NoOfRules ; i++){
572
576
const ConfigInfo::SectionRule & rule = m_info->m_SectionRules [i];
0 commit comments