Browse Source

Fix Coverity issue #545159 and all related issues.

Don't use fmt::format() when formatting wxString objects.  It will throw
an exception on an argument type mismatch which isn't handled in most
code paths.

This also prevents the conversion of the fmt::format() arguments from
wxString to std::string and the result from std::string back to wxString
for the return value.

https://scan8.scan.coverity.com/#/project-view/22886/10844?selectedIssue=545159
revert-0c36e162
Wayne Stambaugh 9 months ago
parent
commit
f5cae044d0
  1. 4
      common/lib_id.cpp

4
common/lib_id.cpp

@ -275,7 +275,7 @@ bool LIB_ID::isLegalLibraryNameChar( unsigned aUniChar )
const wxString LIB_ID::GetFullLibraryName() const
{
if( m_subLibraryName.empty() )
return m_libraryName.c_str();
return m_libraryName;
return fmt::format( "{} - {}", m_libraryName.c_str(), m_subLibraryName.c_str() );
return wxString::Format( wxS( "%s - %s" ), m_libraryName.c_str(), m_subLibraryName.c_str() );
}
Loading…
Cancel
Save