From f88140c95d06f3ee04868022af25247f96d29a9f Mon Sep 17 00:00:00 2001 From: Simon Wells Date: Wed, 9 Sep 2015 00:21:31 +1200 Subject: [PATCH] Fixed RS274X image rotation parsing. If the image was being rotated by a valid amount but not 270 degrees due to the if statements it would already report that there was an invalid value. Also due to the strnicmp only checking the first 2 characters which was valid for 0* but not the rest of the numbers, some values would be able to work that shouldn't --- gerbview/rs274x.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gerbview/rs274x.cpp b/gerbview/rs274x.cpp index 1555477c11..6371404937 100644 --- a/gerbview/rs274x.cpp +++ b/gerbview/rs274x.cpp @@ -434,11 +434,11 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command, case IMAGE_ROTATION: // command IR0* or IR90* or IR180* or IR270* if( strnicmp( text, "0*", 2 ) == 0 ) m_ImageRotation = 0; - if( strnicmp( text, "90*", 2 ) == 0 ) + else if( strnicmp( text, "90*", 3 ) == 0 ) m_ImageRotation = 90; - if( strnicmp( text, "180*", 2 ) == 0 ) + else if( strnicmp( text, "180*", 4 ) == 0 ) m_ImageRotation = 180; - if( strnicmp( text, "270*", 2 ) == 0 ) + else if( strnicmp( text, "270*", 4 ) == 0 ) m_ImageRotation = 270; else ReportMessage( _( "RS274X: Command \"IR\" rotation value not allowed" ) );