From f933f9cf881b4bcb7ec5c6c711e8fec620f3cc58 Mon Sep 17 00:00:00 2001 From: emv Date: Thu, 17 Oct 2013 12:07:09 +0400 Subject: [PATCH] 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) --- src/XSDRAWSTEP/XSDRAWSTEP.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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"); -- 2.39.5