]> Creatis software - bbtk.git/commitdiff
2110 Bug Probleme reading the las line of the file : Read Columns box
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 19 Aug 2013 13:47:05 +0000 (15:47 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 19 Aug 2013 13:47:05 +0000 (15:47 +0200)
packages/std/src/bbstdReadColumnsDouble.cxx
packages/std/src/bbstdReadColumnsInt.cxx
packages/std/src/bbstdReadColumnsString.cxx

index c74a39f..915990f 100644 (file)
@@ -51,7 +51,7 @@ void ReadColumnsDouble::Process()
        }       
        
        int numberOfLines = 0;
-       char tmpValue[50];
+       char tmpValue[1000];
        std::vector<double> *vecData;
        FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
        if (ff1!=NULL)
index ec1452b..2d5443f 100644 (file)
@@ -51,18 +51,21 @@ void ReadColumnsInt::Process()
        }       
        
        int numberOfLines = 0;
-       char tmpValue[50];
+       char tmpValue[1000];
        std::vector<int> *vecData;
        FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
        if (ff1!=NULL)
        {
+                if (!feof(ff1))
+                        fscanf(ff1,"%s",tmpValue);
+
                while (!feof(ff1))
                {
                        for( i=0 ;  i<bbGetInputDimension() ; i++)
                        {
-                               fscanf(ff1,"%s",tmpValue);
                                vecData=tlst[i];
                                vecData->push_back( atoi(tmpValue) );
+                               fscanf(ff1,"%s",tmpValue);
                        }       
                        numberOfLines++;                        
                }       
index 63c14c7..6d9cfe5 100644 (file)
@@ -70,7 +70,6 @@ void ReadColumnsString::Process()
                                fscanf(ff1,"%s ",tmpValue);
                                vecData=tlst[i];
                                vecData->push_back( tmpValue );
-                                       printf("*******************************************EC ReadColumnsString::Last Value: %s \n",tmpValue);
                        }       
                        numberOfLines++;                        
                }