From: szv Date: Wed, 6 Jun 2012 08:28:45 +0000 (+0400) Subject: 0023192: Regression in writestl command X-Git-Tag: V6_5_4_beta1~167 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=48a06a30563e9b6f251760d1959faf289a74f1ea;p=occt-copy.git 0023192: Regression in writestl command Processing of arguments in 'writestl' command is corrected --- diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx index d6dd714002..9c5b0d1818 100755 --- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx +++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx @@ -94,18 +94,17 @@ static Standard_Integer writestl << " shape file [ascii/binary (0/1) : 1 by default] [InParallel (0/1) : 0 by default]" << "\n"; } else { TopoDS_Shape aShape = DBRep::Get(argv[1]); - Standard_Boolean anASCIIMode = Standard_False; + Standard_Boolean isASCIIMode = Standard_False; Standard_Boolean isInParallel = Standard_False; - if (argc==4) { - Standard_Integer mode = atoi(argv[3]); - if (mode==0) anASCIIMode = Standard_True; - } - if (argc==5) { - isInParallel = atoi(argv[4]) == 1; - Standard::SetReentrant(isInParallel); + if (argc > 3) { + isASCIIMode = (atoi(argv[3]) == 0); + if (argc > 4) { + isInParallel = (atoi(argv[4]) == 1); + Standard::SetReentrant(isInParallel); + } } - StlAPI_Writer aWriter; - aWriter.ASCIIMode() = anASCIIMode; + StlAPI_Writer aWriter; + aWriter.ASCIIMode() = isASCIIMode; aWriter.Write (aShape, argv[2], isInParallel); } return 0;