Pcbnew: fix a crash when trying to export a footprint in a non writable directory, or if a non writable old file was existing. (Linux only. On Windows, the wxWidgets file dialog dectects this issue)
This commit is contained in:
parent
ab0e3d0ce2
commit
34217c0199
|
@ -344,6 +344,15 @@ void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule )
|
||||||
pcb_io.Format( aModule );
|
pcb_io.Format( aModule );
|
||||||
|
|
||||||
FILE* fp = wxFopen( dlg.GetPath(), wxT( "wt" ) );
|
FILE* fp = wxFopen( dlg.GetPath(), wxT( "wt" ) );
|
||||||
|
|
||||||
|
if( fp == NULL )
|
||||||
|
{
|
||||||
|
wxMessageBox( wxString::Format(
|
||||||
|
_( "Unable to create or write file '%s'" ),
|
||||||
|
GetChars( dlg.GetPath() ) ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fprintf( fp, "%s", pcb_io.GetStringOutput( false ).c_str() );
|
fprintf( fp, "%s", pcb_io.GetStringOutput( false ).c_str() );
|
||||||
fclose( fp );
|
fclose( fp );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue