From 058f2bffd0828a91cb834d327352fa08f6bd99f2 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 22 Mar 2018 11:58:55 +0100 Subject: [PATCH] Spice simulator: safety check --- eeschema/sim/ngspice.cpp | 2 +- eeschema/sim/sim_plot_frame.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eeschema/sim/ngspice.cpp b/eeschema/sim/ngspice.cpp index 3ba4b97662..d9990457c6 100644 --- a/eeschema/sim/ngspice.cpp +++ b/eeschema/sim/ngspice.cpp @@ -207,7 +207,7 @@ bool NGSPICE::LoadNetlist( const string& aNetlist ) m_netlist += std::string( line ) + std::string( "\n" ); } - lines.push_back( nullptr ); + lines.push_back( nullptr ); // sentinel, as requested in ngSpice_Circ description m_ngSpice_Circ( lines.data() ); for( auto line : lines ) diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index fbf344da46..850e586c12 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -87,6 +87,10 @@ public: case SIM_RUNNING: event = new wxCommandEvent( EVT_SIM_STARTED ); break; + + default: + wxFAIL; + return; } wxQueueEvent( m_parent, event );