fixed #1981
authorMaria Dimashova <no@email>
Thu, 24 May 2012 16:52:14 +0000 (16:52 +0000)
committerMaria Dimashova <no@email>
Thu, 24 May 2012 16:52:14 +0000 (16:52 +0000)
modules/ml/src/data.cpp

index 9bf4674..01d51da 100644 (file)
@@ -195,12 +195,13 @@ int CvMLData::read_csv(const char* filename)
             ptr++;
     }
 
+       cols_count++;
+
     if ( cols_count == 0)
     {
         fclose(file);
         return -1;
     }
-    cols_count++;
 
     // create temporary memory storage to store the whole database
     el_ptr = new float[cols_count];