Use append mode, and fopen_s when applicable for cipher_profile
This commit is contained in:
parent
714bff612b
commit
a11341d185
|
@ -1206,17 +1206,22 @@ int sqlcipher_codec_add_random(codec_ctx *ctx, const char *zRight, int random_sz
|
|||
|
||||
int sqlcipher_cipher_profile(sqlite3 *db, const char *destination){
|
||||
FILE *f;
|
||||
if( strcmp(destination,"stdout")==0 ){
|
||||
if(sqlite3StrICmp(destination, "stdout") == 0){
|
||||
f = stdout;
|
||||
}else if( strcmp(destination, "stderr")==0 ){
|
||||
}else if(sqlite3StrICmp(destination, "stderr") == 0){
|
||||
f = stderr;
|
||||
}else if( strcmp(destination, "off")==0 ){
|
||||
}else if(sqlite3StrICmp(destination, "off") == 0){
|
||||
f = 0;
|
||||
}else{
|
||||
f = fopen(destination, "wb");
|
||||
#if defined(_WIN32) && (__STDC_VERSION__ > 199901L)
|
||||
if(fopen_s(&f, destination, "a") != 0){
|
||||
#else
|
||||
f = fopen(destination, "a");
|
||||
if(f == 0){
|
||||
#endif
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
}
|
||||
sqlite3_profile(db, sqlcipher_profile_callback, f);
|
||||
return SQLITE_OK;
|
||||
|
|
Loading…
Reference in New Issue