From: emv Date: Thu, 17 Oct 2013 08:07:09 +0000 (+0400) Subject: 0024246: Draw command stepread given whithout arguments throws an exception X-Git-Tag: V6_7_0_beta~72 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=f933f9cf881b4bcb7ec5c6c711e8fec620f3cc58;p=occt-copy.git 0024246: Draw command stepread given whithout arguments throws an exception To stepread command added check for the number of arguments. Minor correction (return 1 to indicate error) --- diff --git a/src/XSDRAWSTEP/XSDRAWSTEP.cxx b/src/XSDRAWSTEP/XSDRAWSTEP.cxx index 12e1bf52fa..4668a8f937 100755 --- a/src/XSDRAWSTEP/XSDRAWSTEP.cxx +++ b/src/XSDRAWSTEP/XSDRAWSTEP.cxx @@ -98,6 +98,10 @@ void XSDRAWSTEP::Init () static Standard_Integer stepread (Draw_Interpretor& di/*theCommands*/, Standard_Integer argc, const char** argv) { + if (argc < 3) { + di << "Use: stepread [file] [f or r (type of model full or reduced)]\n"; + return 1; + } // On admet le controller AP214 ou une variante DeclareAndCast(STEPControl_Controller,ctl,XSDRAW::Controller()); if (ctl.IsNull()) XSDRAW::SetNorm("STEP");