Skip to content

Commit 934b69d

Browse files
author
jef
committed
fix #1857
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11477 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3f33638 commit 934b69d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/app/qgsspatialitesourceselect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ sqlite3 *QgsSpatiaLiteSourceSelect::openSpatiaLiteDb( const char *path )
179179
QString errCause;
180180

181181
// trying to open the SQLite DB
182-
mSqlitePath = path;
182+
mSqlitePath = QString::fromUtf8( path );
183183

184-
ret = sqlite3_open_v2( path, &handle, SQLITE_OPEN_READWRITE, NULL );
184+
ret = sqlite3_open_v2( mSqlitePath.toUtf8().constData(), &handle, SQLITE_OPEN_READWRITE, NULL );
185185
if ( ret )
186186
{
187187
// failure

src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,6 @@ void QgsSpatiaLiteProvider::closeDb()
13651365

13661366
QgsSpatiaLiteProvider::SqliteHandles * QgsSpatiaLiteProvider::SqliteHandles::openDb( const QString & dbPath )
13671367
{
1368-
char path[1024];
13691368
sqlite3 *sqlite_handle;
13701369

13711370
QMap < QString, QgsSpatiaLiteProvider::SqliteHandles * >&handles = QgsSpatiaLiteProvider::SqliteHandles::handles;
@@ -1378,8 +1377,7 @@ QgsSpatiaLiteProvider::SqliteHandles * QgsSpatiaLiteProvider::SqliteHandles::ope
13781377
}
13791378

13801379
QgsDebugMsg( QString( "New sqlite connection for " ) + dbPath );
1381-
strcpy( path, dbPath.toUtf8().constData() );
1382-
if ( sqlite3_open_v2( path, &sqlite_handle, SQLITE_OPEN_READWRITE, NULL ) )
1380+
if ( sqlite3_open_v2( dbPath.toUtf8().constData(), &sqlite_handle, SQLITE_OPEN_READWRITE, NULL ) )
13831381
{
13841382
// failure
13851383

0 commit comments

Comments
 (0)