[MOAB-dev] r3338 - MOAB/trunk

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Thu Nov 12 16:01:46 CST 2009


Author: kraftche
Date: 2009-11-12 16:01:46 -0600 (Thu, 12 Nov 2009)
New Revision: 3338

Modified:
   MOAB/trunk/ReadNASTRAN.cpp
Log:
return failure (rather than segfaulting) if input file does not exist

Modified: MOAB/trunk/ReadNASTRAN.cpp
===================================================================
--- MOAB/trunk/ReadNASTRAN.cpp	2009-11-12 21:11:33 UTC (rev 3337)
+++ MOAB/trunk/ReadNASTRAN.cpp	2009-11-12 22:01:46 UTC (rev 3338)
@@ -101,7 +101,8 @@
      has the same format. */  
   std::string line;
   std::ifstream file (filename);
-  getline(file,line);
+  if (!getline(file,line))
+    return MB_FILE_DOES_NOT_EXIST;
   line_format format;
   result = determine_line_format( line, format );
   if(MB_SUCCESS != result) return result;



More information about the moab-dev mailing list