Pcbnew: Fpid parser: Fix crash when reading a .kicad_pcb file containing a valid fpid with a revision value.
Fix an issue when a .kicad_pcb file contains an incorrect fpid ( containing a '/ ' in footprint section ) . After saving the board the file was no more readable, due to a broken fpid saved in file (can happens in old .kicad_pcb files, coming from the bzr 4022 stable version, and/or in files converted from an other EDA tool like altium) Fix 2 very minor coverity warnings.
This commit is contained in:
+6
-2
@@ -456,7 +456,7 @@ wxString GetIllegalFileNameWxChars()
|
||||
}
|
||||
|
||||
|
||||
bool ReplaceIllegalFileNameChars( std::string* aName )
|
||||
bool ReplaceIllegalFileNameChars( std::string* aName, int aReplaceChar )
|
||||
{
|
||||
bool changed = false;
|
||||
std::string result;
|
||||
@@ -465,7 +465,11 @@ bool ReplaceIllegalFileNameChars( std::string* aName )
|
||||
{
|
||||
if( strchr( illegalFileNameChars, *it ) )
|
||||
{
|
||||
StrPrintf( &result, "%%%02x", *it );
|
||||
if( aReplaceChar )
|
||||
StrPrintf( &result, "%c", aReplaceChar );
|
||||
else
|
||||
StrPrintf( &result, "%%%02x", *it );
|
||||
|
||||
changed = true;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user