diff --git a/src/shared/file.c b/src/shared/file.c index 16a419b..898277d 100644 --- a/src/shared/file.c +++ b/src/shared/file.c @@ -446,7 +446,7 @@ static bool file_to_disk_secure_impl(const char* path, const void* data, format. */ int tmp_size; if (scratch_dirfd >= 0) - tmp_size = snprintf(NULL, 0, ".%s.tmp.%ld.%llu", leaf, (long)getpid(), ULLONG_MAX); + tmp_size = snprintf(NULL, 0, ".%s.tmp.%ld.%llu", leaf, (long)getpid(), ~0ULL); else tmp_size = snprintf(NULL, 0, ".%s.tmp.%ld.%u", leaf, (long)getpid(), 999U); if (tmp_size < 0) { diff --git a/tests/test_scanner.c b/tests/test_scanner.c index 2b736a5..0044f87 100644 --- a/tests/test_scanner.c +++ b/tests/test_scanner.c @@ -591,13 +591,11 @@ static void test_scanner_one_file_system_cross_device() { snprintf(shm_file, sizeof(shm_file), "%s/inside.txt", shm_dir); bool ready = mkdir(nested, 0755) == 0 && symlink(shm_dir, link_path) == 0; - if (ready) + if (ready) { create_test_file(root_file, "keep"); - if (ready) create_test_file(shm_file, "cross"); + } - int rc, total; - bool found; int seq_off_rc, seq_off_total, seq_on_rc, seq_on_total; bool seq_off_found, seq_on_found; int par_off_rc, par_off_total, par_on_rc, par_on_total; @@ -607,6 +605,8 @@ static void test_scanner_one_file_system_cross_device() { seq_off_total = seq_on_total = par_off_total = par_on_total = 0; seq_off_found = seq_on_found = par_off_found = par_on_found = false; } else { + int rc, total; + bool found; rc = collect_directory_scan(root_dir, false, "inside.txt", &found, &total); seq_off_rc = rc; seq_off_total = total;