Browse Source

Bug fix in csvreads. (Bug #1423) (#1430)

* Bug fix in csvreads.
AdithyaPediredla 5 years ago
parent
commit
546452da5a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      include/igl/readCSV.cpp

+ 6 - 2
include/igl/readCSV.cpp

@@ -1,5 +1,5 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <[email protected]>
 // 
 // This Source Code Form is subject to the terms of the Mozilla Public License 
@@ -30,8 +30,12 @@ IGL_INLINE bool igl::readCSV(
     std::istringstream iss(line);
     vector<Scalar> temp;
     Scalar a;
-    while (iss >> a)
+    char ch;
+    while (iss >> a){
       temp.push_back(a);
+      if(!(iss >> ch))
+        break;
+    }
 
     if (temp.size() != 0) // skip empty lines
       Mt.push_back(temp);