[QGIS Commit] r15847 - trunk/qgis/src/providers/spatialite
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Thu Apr 28 19:54:24 EDT 2011
Author: jef
Date: 2011-04-28 16:54:24 -0700 (Thu, 28 Apr 2011)
New Revision: 15847
Modified:
trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp
Log:
fix #3782
Modified: trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp
===================================================================
--- trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp 2011-04-28 22:15:02 UTC (rev 15846)
+++ trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp 2011-04-28 23:54:24 UTC (rev 15847)
@@ -3366,12 +3366,8 @@
else if ( type == QVariant::String )
{
// binding a TEXT value
- QString txt = it->toString();
- int len = txt.toUtf8().length() + 1;
- char *vl = new char [len];
- strcpy( vl, txt.toUtf8().constData() );
- sqlite3_bind_text( stmt, ++ia, vl, len, SQLITE_TRANSIENT );
- delete [] vl;
+ QByteArray ba = it->toString().toUtf8();
+ sqlite3_bind_text( stmt, ++ia, ba.constData(), ba.size(), SQLITE_TRANSIENT );
}
else
{
More information about the QGIS-commit
mailing list