From 85a407e259d9ac73de3937e1f0bc25771a0509eb Mon Sep 17 00:00:00 2001 From: Nick Parker Date: Mon, 7 Mar 2016 14:35:07 -0600 Subject: [PATCH] Move declaration to top level of block --- src/crypto.c | 2 +- src/crypto_cc.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index 2f3ee4e..c8941f7 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -79,6 +79,7 @@ static int codec_set_pass_key(sqlite3* db, int nDb, const void *zKey, int nKey, } int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLeft, const char *zRight) { + char *pragma_cipher_deprecated_msg = "PRAGMA cipher command is deprecated, please remove from usage."; struct Db *pDb = &db->aDb[iDb]; codec_ctx *ctx = NULL; int rc; @@ -144,7 +145,6 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef if(ctx) { if( zRight ) { sqlcipher_codec_ctx_set_cipher(ctx, zRight, 2); // change cipher for both - char *pragma_cipher_deprecated_msg = "PRAGMA cipher command is deprecated, please remove from usage."; codec_vdbe_return_static_string(pParse, "cipher", pragma_cipher_deprecated_msg); sqlite3_log(SQLITE_WARNING, pragma_cipher_deprecated_msg); return SQLITE_ERROR; diff --git a/src/crypto_cc.c b/src/crypto_cc.c index 077bed5..7890ff8 100644 --- a/src/crypto_cc.c +++ b/src/crypto_cc.c @@ -52,11 +52,12 @@ static const char* sqlcipher_cc_get_provider_name(void *ctx) { static const char* sqlcipher_cc_get_provider_version(void *ctx) { #if TARGET_OS_MAC + CFTypeRef version; CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.security")); if(bundle == NULL) { return "unknown"; } - CFTypeRef version = CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleShortVersionString")); + version = CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleShortVersionString")); return CFStringGetCStringPtr(version, kCFStringEncodingUTF8); #else return "unknown";