Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix warnings
  • Loading branch information
jef-n committed Dec 26, 2015
1 parent 573a4b7 commit 46f283b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -3696,7 +3696,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
{
// some unexpected error occurred
const char *err = sqlite3_errmsg( sqliteHandle );
errMsg = ( char * ) sqlite3_malloc( strlen( err ) + 1 );
errMsg = ( char * ) sqlite3_malloc(( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
break;
}
Expand Down Expand Up @@ -3771,7 +3771,7 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id )
{
// some unexpected error occurred
const char *err = sqlite3_errmsg( sqliteHandle );
errMsg = ( char * ) sqlite3_malloc( strlen( err ) + 1 );
errMsg = ( char * ) sqlite3_malloc(( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
goto abort;
}
Expand Down Expand Up @@ -4031,7 +4031,7 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( QgsGeometryMap & geometry_map
{
// some unexpected error occurred
const char *err = sqlite3_errmsg( sqliteHandle );
errMsg = ( char * ) sqlite3_malloc( strlen( err ) + 1 );
errMsg = ( char * ) sqlite3_malloc(( int ) strlen( err ) + 1 );
strcpy( errMsg, err );
goto abort;
}
Expand Down
4 changes: 2 additions & 2 deletions src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
Expand Up @@ -306,8 +306,8 @@ int vtable_create_connect( sqlite3* sql, void* aux, int argc, const char* const*
Q_UNUSED( aux );
Q_UNUSED( is_created );

#define RETURN_CSTR_ERROR(err) if (out_err) {size_t s = strlen(err); *out_err=(char*)sqlite3_malloc(s+1); strncpy(*out_err, err, s);}
#define RETURN_CPPSTR_ERROR(err) if (out_err) {*out_err=(char*)sqlite3_malloc(err.size()+1); strncpy(*out_err, err.c_str(), err.size());}
#define RETURN_CSTR_ERROR(err) if (out_err) {size_t s = strlen(err); *out_err=(char*)sqlite3_malloc( (int) s+1); strncpy(*out_err, err, s);}
#define RETURN_CPPSTR_ERROR(err) if (out_err) {*out_err=(char*)sqlite3_malloc( (int) err.size()+1); strncpy(*out_err, err.c_str(), err.size());}

if ( argc < 4 )
{
Expand Down

0 comments on commit 46f283b

Please sign in to comment.