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

Peter Kümmel syntheticpp at yahoo.com
Sat Nov 14 18:11:06 CET 2009


SVN commit 1049189 by kuemmel:

don't crash when compiled with msvc (malloc and free are in different dlls)

 M  +2 -3      ascii.cpp  


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


More information about the Kst mailing list