From 014ba087a845fe9c2b0657a88468dcaabb1a7d13 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 10 May 2012 13:02:44 +0200 Subject: [PATCH] Gerbview: fix incorrect processing of ICI command in Excellon drill files. --- gerbview/excellon_read_drill_file.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gerbview/excellon_read_drill_file.cpp b/gerbview/excellon_read_drill_file.cpp index d6da6b7c7a..fc474c9241 100644 --- a/gerbview/excellon_read_drill_file.cpp +++ b/gerbview/excellon_read_drill_file.cpp @@ -390,7 +390,19 @@ bool EXCELLON_IMAGE::Execute_HEADER_Command( char*& text ) break; case DRILL_INCREMENTALHEADER: - m_Relative = true; + if( *text != ',' ) + { + ReportMessage( _( "ICI command has no parameter" ) ); + break; + } + text++; // skip separator + // Parameter should be ON or OFF + if( strnicmp( text, "OFF", 3 ) == 0 ) + m_Relative = false; + else if( strnicmp( text, "ON", 2 ) == 0 ) + m_Relative = true; + else + ReportMessage( _( "ICI command has incorrect parameter" ) ); break; case DRILL_TOOL_CHANGE_STOP: