From 48a06a30563e9b6f251760d1959faf289a74f1ea Mon Sep 17 00:00:00 2001 From: szv Date: Wed, 6 Jun 2012 12:28:45 +0400 Subject: [PATCH] 0023192: Regression in writestl command Processing of arguments in 'writestl' command is corrected --- src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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; -- 2.20.1