From e2b3aed2fe53053b8c9845fa132d7e1976adea8b Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 29 Dec 2024 16:26:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20linux=20=E5=9C=B0=E5=9D=80=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hook/hook.cc | 5 ++++- test/sqlite3.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hook/hook.cc b/src/hook/hook.cc index 78c6be4..d81b6d8 100644 --- a/src/hook/hook.cc +++ b/src/hook/hook.cc @@ -63,7 +63,10 @@ bool Hook::is_feature_code_matched(const uint8_t *data) { const uint8_t *Hook::search_feature_code(const uint8_t *data, size_t size) { spdlog::debug("search_feature_code: {} - {}", (void *)data, size); const uint8_t * result = nullptr; - for (size_t i = 0; i < size * 0.9; ++i) { + #ifdef _WIN32 + size = size*0.9; + #endif + for (size_t i = 0; i < size; ++i) { // spdlog::info("Check: {}", i); if (is_feature_code_matched(data + i)) { if (result != nullptr) diff --git a/test/sqlite3.c b/test/sqlite3.c index 6f8c003..8d72b3c 100644 --- a/test/sqlite3.c +++ b/test/sqlite3.c @@ -90726,11 +90726,11 @@ SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){ } db = v->db; sqlite3_mutex_enter(db->mutex); - while( (rc = sqlite3Step(v))==SQLITE_SCHEMA - && cnt++ < SQLITE_MAX_SCHEMA_RETRY ){ + while( (rc = sqlite3Step(v))==SQLITE_SCHEMA /** 17 */ + && cnt++ < SQLITE_MAX_SCHEMA_RETRY /** 50 */){ int savedPc = v->pc; rc = sqlite3Reprepare(v); - if( rc!=SQLITE_OK ){ + if( rc!=SQLITE_OK/* 0 */ ){ /* This case occurs after failing to recompile an sql statement. ** The error message from the SQL compiler has already been loaded ** into the database handle. This block copies the error message