Skip to content

Commit 4bad0ae

Browse files
committed
[HTML] Ensure safe global locale fallback setup: style adjustments
1 parent 00d6e4f commit 4bad0ae

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

engine/report/report_html_sim.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,9 +1164,10 @@ void print_profilesets( std::ostream& out, const profileset::profilesets_t& prof
11641164
out << "</div>";
11651165
}
11661166

1167-
void set_global_locale( ) {
1167+
void set_global_locale()
1168+
{
11681169
// Set global locale to en-US for consistent number formatting
1169-
for (const auto& name :
1170+
for ( const auto& name :
11701171
{
11711172
"en_US.UTF-8",
11721173
"en_US.utf8",
@@ -1175,15 +1176,17 @@ void set_global_locale( ) {
11751176
"en-US",
11761177
"English_United States.1252",
11771178
"C"
1178-
})
1179+
} )
11791180
{
1180-
try {
1181-
std::locale::global(std::locale(name));
1181+
try
1182+
{
1183+
std::locale::global( std::locale( name ) );
11821184
return;
1183-
} catch (const std::runtime_error&)
1185+
}
1186+
catch ( const std::runtime_error& )
11841187
{ }
11851188
}
1186-
std::locale::global(std::locale::classic());
1189+
std::locale::global( std::locale::classic() );
11871190
}
11881191

11891192
/* Main function building the html document and calling subfunctions

0 commit comments

Comments
 (0)