From ddec8036c124c5cdfd3d81620aa65dbd6cbefb68 Mon Sep 17 00:00:00 2001 From: Andrey Fedorushkov <1694456@bugs.launchpad.net> Date: Wed, 31 May 2017 15:43:28 +0200 Subject: [PATCH] Eeschema: fix an other erroneous "unit value out of range" test. --- eeschema/sch_component.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index edf8e46033..8f249c915c 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -55,6 +55,8 @@ #include #include +#include // for MAX_UNIT_COUNT_PER_PACKAGE definition + #define NULL_STRING "_NONAME_" /** @@ -1457,7 +1459,8 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg ) int multi = atoi( name1 ); - if( multi < 0 || multi > 26 ) + // Avoid out of range multi id: + if( multi < 0 || multi > MAX_UNIT_COUNT_PER_PACKAGE ) multi = 1; AddHierarchicalReference( path, ref, multi );