fix: cppcheck cleanups (printf sentinel type, scanner test style)
CI / lint (push) Successful in 22s
CI / sanitizers (address) (push) Successful in 40s
CI / sanitizers (undefined) (push) Successful in 39s
CI / fuzz-build (push) Successful in 16s
CI / coverage (push) Successful in 34s
CI / build-and-test (push) Successful in 1m23s
CI / valgrind (push) Successful in 36s
CI / lint (push) Successful in 22s
CI / sanitizers (address) (push) Successful in 40s
CI / sanitizers (undefined) (push) Successful in 39s
CI / fuzz-build (push) Successful in 16s
CI / coverage (push) Successful in 34s
CI / build-and-test (push) Successful in 1m23s
CI / valgrind (push) Successful in 36s
This commit is contained in:
+1
-1
@@ -446,7 +446,7 @@ static bool file_to_disk_secure_impl(const char* path, const void* data,
|
|||||||
format. */
|
format. */
|
||||||
int tmp_size;
|
int tmp_size;
|
||||||
if (scratch_dirfd >= 0)
|
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
|
else
|
||||||
tmp_size = snprintf(NULL, 0, ".%s.tmp.%ld.%u", leaf, (long)getpid(), 999U);
|
tmp_size = snprintf(NULL, 0, ".%s.tmp.%ld.%u", leaf, (long)getpid(), 999U);
|
||||||
if (tmp_size < 0) {
|
if (tmp_size < 0) {
|
||||||
|
|||||||
@@ -591,13 +591,11 @@ static void test_scanner_one_file_system_cross_device() {
|
|||||||
snprintf(shm_file, sizeof(shm_file), "%s/inside.txt", shm_dir);
|
snprintf(shm_file, sizeof(shm_file), "%s/inside.txt", shm_dir);
|
||||||
|
|
||||||
bool ready = mkdir(nested, 0755) == 0 && symlink(shm_dir, link_path) == 0;
|
bool ready = mkdir(nested, 0755) == 0 && symlink(shm_dir, link_path) == 0;
|
||||||
if (ready)
|
if (ready) {
|
||||||
create_test_file(root_file, "keep");
|
create_test_file(root_file, "keep");
|
||||||
if (ready)
|
|
||||||
create_test_file(shm_file, "cross");
|
create_test_file(shm_file, "cross");
|
||||||
|
}
|
||||||
|
|
||||||
int rc, total;
|
|
||||||
bool found;
|
|
||||||
int seq_off_rc, seq_off_total, seq_on_rc, seq_on_total;
|
int seq_off_rc, seq_off_total, seq_on_rc, seq_on_total;
|
||||||
bool seq_off_found, seq_on_found;
|
bool seq_off_found, seq_on_found;
|
||||||
int par_off_rc, par_off_total, par_on_rc, par_on_total;
|
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_total = seq_on_total = par_off_total = par_on_total = 0;
|
||||||
seq_off_found = seq_on_found = par_off_found = par_on_found = false;
|
seq_off_found = seq_on_found = par_off_found = par_on_found = false;
|
||||||
} else {
|
} else {
|
||||||
|
int rc, total;
|
||||||
|
bool found;
|
||||||
rc = collect_directory_scan(root_dir, false, "inside.txt", &found, &total);
|
rc = collect_directory_scan(root_dir, false, "inside.txt", &found, &total);
|
||||||
seq_off_rc = rc;
|
seq_off_rc = rc;
|
||||||
seq_off_total = total;
|
seq_off_total = total;
|
||||||
|
|||||||
Reference in New Issue
Block a user