Commit d4e04dcc authored by jean-pierre charras's avatar jean-pierre charras

Fix bugs detected by Cppcheck.

parent 79e2a414
...@@ -812,10 +812,11 @@ void OPENGL_GAL::drawLineQuad( const VECTOR2D& aStartPoint, const VECTOR2D& aEnd ...@@ -812,10 +812,11 @@ void OPENGL_GAL::drawLineQuad( const VECTOR2D& aStartPoint, const VECTOR2D& aEnd
VECTOR2D startEndVector = aEndPoint - aStartPoint; VECTOR2D startEndVector = aEndPoint - aStartPoint;
double lineLength = startEndVector.EuclideanNorm(); double lineLength = startEndVector.EuclideanNorm();
double scale = 0.5 * lineWidth / lineLength;
if( lineLength <= 0.0 ) if( lineLength <= 0.0 )
return; return;
double scale = 0.5 * lineWidth / lineLength;
// The perpendicular vector also needs transformations // The perpendicular vector also needs transformations
glm::vec4 vector = currentManager->GetTransformation() * glm::vec4 vector = currentManager->GetTransformation() *
......
...@@ -218,7 +218,7 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event ) ...@@ -218,7 +218,7 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
bool equ_is_unique = true; bool equ_is_unique = true;
unsigned next = idx+1; unsigned next = idx+1;
unsigned previous = idx-1; int previous = idx-1;
if( next < equiv_List.size() && if( next < equiv_List.size() &&
equivItem.m_ComponentValue == equiv_List[next].m_ComponentValue ) equivItem.m_ComponentValue == equiv_List[next].m_ComponentValue )
......
...@@ -74,7 +74,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source ) ...@@ -74,7 +74,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
m_Bold = source->m_Bold; m_Bold = source->m_Bold;
m_HJustify = source->m_HJustify; m_HJustify = source->m_HJustify;
m_VJustify = source->m_VJustify; m_VJustify = source->m_VJustify;
m_MultilineAllowed = m_MultilineAllowed; m_MultilineAllowed = source->m_MultilineAllowed;
m_Text = source->m_Text; m_Text = source->m_Text;
} }
......
...@@ -45,6 +45,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) ...@@ -45,6 +45,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
wxPoint pos; wxPoint pos;
strncpy( line, cmdline, sizeof(line) - 1 ); strncpy( line, cmdline, sizeof(line) - 1 );
line[sizeof(line) - 1] = 0;
idcmd = strtok( line, " \n\r" ); idcmd = strtok( line, " \n\r" );
text = strtok( NULL, " \n\r" ); text = strtok( NULL, " \n\r" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment