Fix logic/correctness bugs (#73, #68, #67, #66, #59, #58, #54, #48, #53) #88

Merged
TapTap merged 1 commits from fix/logic-correctness into main 2026-07-21 15:00:48 +02:00
2 changed files with 2 additions and 2 deletions
+2
View File
@@ -23,6 +23,8 @@ static bool is_excluded(const char* path, const Config* config) {
char* path_dup = str_dup(path); char* path_dup = str_dup(path);
if (!path_dup) if (!path_dup)
return false; return false;
/* basename(3) may return a pointer into path_dup or a static buffer;
* either way we free path_dup, not fname. */
char* fname = basename(path_dup); char* fname = basename(path_dup);
// Check exclude patterns // Check exclude patterns
-2
View File
@@ -248,8 +248,6 @@ static void test_scanner_max_size() {
const char* dir = "test_scan_max"; const char* dir = "test_scan_max";
const char* small = "test_scan_max/small.txt"; const char* small = "test_scan_max/small.txt";
const char* large = "test_scan_max/large.txt"; const char* large = "test_scan_max/large.txt";
create_test_file(small, "tiny");
create_test_file(large, "this_content_is_longer_than_ten_chars");
mkdir(dir, 0755); mkdir(dir, 0755);
create_test_file(small, "tiny"); create_test_file(small, "tiny");