Skip to content

Commit f7cf467

Browse files
committed
[HTML] Ensure safe global locale fallback setup: style adjustments
1 parent be8c3ff commit f7cf467

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

‎engine/report/report_html_sim.cpp‎

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

1173-
void set_global_locale( ) {
1173+
void set_global_locale()
1174+
{
11741175
// Set global locale to en-US for consistent number formatting
1175-
for (const auto& name :
1176+
for ( const auto& name :
11761177
{
11771178
"en_US.UTF-8",
11781179
"en_US.utf8",
@@ -1181,15 +1182,17 @@ void set_global_locale( ) {
11811182
"en-US",
11821183
"English_United States.1252",
11831184
"C"
1184-
})
1185+
} )
11851186
{
1186-
try {
1187-
std::locale::global(std::locale(name));
1187+
try
1188+
{
1189+
std::locale::global( std::locale( name ) );
11881190
return;
1189-
} catch (const std::runtime_error&)
1191+
}
1192+
catch ( const std::runtime_error& )
11901193
{ }
11911194
}
1192-
std::locale::global(std::locale::classic());
1195+
std::locale::global( std::locale::classic() );
11931196
}
11941197

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

0 commit comments

Comments
 (0)