[Kst] branches/work/kst/portto4/kst/src/datasources/ascii

George Staikos staikos at kde.org
Mon Oct 1 22:38:12 CEST 2007


SVN commit 719757 by staikos:

make sure the lifetime doesn't expire on the internal pointer


 M  +3 -1      ascii.cpp  


--- branches/work/kst/portto4/kst/src/datasources/ascii/ascii.cpp #719756:719757
@@ -314,7 +314,7 @@
   int bufstart, bufread;
   bool new_data = false;
   char tmpbuf[MAXBUFREADLEN+1];
-  const char *del = _config->_delimiters.toLatin1(); // beware
+  char *del = strdup(_config->_delimiters.toLatin1());
   
   do {
     /* Read the tmpbuffer, starting at row_index[_numFrames] */
@@ -355,6 +355,8 @@
     }
   } while (bufread == MAXBUFREADLEN);
   
+  free(del);
+
   file.close();
 
   updateNumFramesScalar();


More information about the Kst mailing list