8000 restore use of ArraySize convenience function · magic-coder/sqlcipher@16167e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16167e9

Browse files
restore use of ArraySize convenience function
1 parent f291262 commit 16167e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crypto_impl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ int sqlcipher_codec_ctx_migrate(codec_ctx *ctx) {
10171017
commands[2] = attach_command;
10181018
commands[3] = "SELECT sqlcipher_export('migrate');";
10191019

1020-
for(command_idx = 0; command_idx < (sizeof(commands)/sizeof(commands[0])); command_idx++){
1020+
for(command_idx = 0; command_idx < ArraySize(commands); command_idx++){
10211021
const char *command = commands[command_idx];
10221022
if(strcmp(command, "") == 0){
10231023
continue;
@@ -1070,7 +1070,7 @@ int sqlcipher_codec_ctx_migrate(codec_ctx *ctx) {
10701070
sqlite3CodecGetKey(db, db->nDb - 1, (void**)&key, &password_sz);
10711071
sqlite3CodecAttach(db, 0, key, password_sz);
10721072

1073-
for(i=0; i<(sizeof(aCopy)/sizeof(aCopy[0])); i+=2){
1073+
for(i=0; i<ArraySize(aCopy); i+=2){
10741074
sqlite3BtreeGetMeta(pSrc, aCopy[i], &meta);
10751075
rc = sqlite3BtreeUpdateMeta(pDest, aCopy[i], meta+aCopy[i+1]);
10761076
if( NEVER(rc!=SQLITE_OK) ) goto handle_error;

0 commit comments

Comments
 (0)
0