@@ -78,7 +78,7 @@ static int codec_set_pass_key(sqlite3* db, int nDb, const void *zKey, int nKey,
7878 return SQLITE_ERROR ;
7979}
8080
81- int codec_pragma (sqlite3 * db , int iDb , Parse * pParse , const char * zLeft , const char * zRight ) {
81+ int sqlcipher_codec_pragma (sqlite3 * db , int iDb , Parse * pParse , const char * zLeft , const char * zRight ) {
8282 struct Db * pDb = & db -> aDb [iDb ];
8383 codec_ctx * ctx = NULL ;
8484 int rc ;
@@ -87,8 +87,8 @@ int codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLeft, const c
8787 sqlite3pager_get_codec (pDb -> pBt -> pBt -> pPager , (void * * ) & ctx );
8888 }
8989
90- CODEC_TRACE (("codec_pragma : entered db=%p iDb=%d pParse=%p zLeft=%s zRight=%s ctx=%p\n" , db , iDb , pParse , zLeft , zRight , ctx ));
91-
90+ CODEC_TRACE (("sqlcipher_codec_pragma : entered db=%p iDb=%d pParse=%p zLeft=%s zRight=%s ctx=%p\n" , db , iDb , pParse , zLeft , zRight , ctx ));
91+
9292 if ( sqlite3StrICmp (zLeft , "cipher_migrate" )== 0 && !zRight ){
9393 if (ctx ){
9494 char * migrate_status = sqlite3_mprintf ("%d" , sqlcipher_codec_ctx_migrate (ctx ));
@@ -341,12 +341,12 @@ void sqlite3_activate_see(const char* in) {
341341 /* do nothing, security enhancements are always active */
342342}
343343
344- int sqlcipher_find_db_index (sqlite3 * db , const char * zDb ) {
344+ static int sqlcipher_find_db_index (sqlite3 * db , const char * zDb ) {
345345 if (zDb == NULL ){
346346 return 0 ;
347347 }
348348 int db_index ;
349- for (db_index = 0 ; db_index < db -> nDb - 1 ; db_index ++ ) {
349+ for (db_index = 0 ; db_index < db -> nDb ; db_index ++ ) {
350350 struct Db * pDb = & db -> aDb [db_index ];
351351 if (strcmp (pDb -> zName , zDb ) == 0 ) {
352352 return db_index ;
0 commit comments