d747d1a8fe
- tests: Fix formatting and snprintf warnings in tests. (bcl) - ui: Add checks for prompt being NULL (bcl) - strlist: Handle realloc error in wchar_to_str (bcl) - libparted: Fix potential NULL dereference in ped_disk_next_partition (bcl) - filesys: Check for null from close_fn (bcl)
47 lines
1.9 KiB
Diff
47 lines
1.9 KiB
Diff
From d272bb5b5343fd288a204314654a7fbaea84528d Mon Sep 17 00:00:00 2001
|
|
From: "Brian C. Lane" <bcl@redhat.com>
|
|
Date: Wed, 15 Feb 2023 11:52:42 -0800
|
|
Subject: [PATCH 22/24] tests: Fix formatting and snprintf warnings in tests.
|
|
|
|
The assert message includes sector values, which are long long int, so
|
|
use the proper formatting of %lld.
|
|
|
|
The snprintf warning complained about trying to write 258 bytes so I
|
|
bumped the buffer size up to 259. The return value is already being
|
|
checked for truncation so this is just to keep the compiler happy
|
|
without having to suppress the warning.
|
|
---
|
|
libparted/tests/disk.c | 2 +-
|
|
libparted/tests/symlink.c | 2 +-
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/libparted/tests/disk.c b/libparted/tests/disk.c
|
|
index f7b16a5..a2e304c 100644
|
|
--- a/libparted/tests/disk.c
|
|
+++ b/libparted/tests/disk.c
|
|
@@ -75,7 +75,7 @@ START_TEST (test_duplicate)
|
|
ck_assert_msg(part->geom.start == part_dup->geom.start &&
|
|
part->geom.end == part_dup->geom.end,
|
|
"Duplicated partition %d doesn't match. "
|
|
- "Details are start: %d/%d end: %d/%d\n",
|
|
+ "Details are start: %lld/%lld end: %lld/%lld\n",
|
|
*i, part->geom.start, part_dup->geom.start,
|
|
part->geom.end, part_dup->geom.end);
|
|
}
|
|
diff --git a/libparted/tests/symlink.c b/libparted/tests/symlink.c
|
|
index da6bef8..7be02cd 100644
|
|
--- a/libparted/tests/symlink.c
|
|
+++ b/libparted/tests/symlink.c
|
|
@@ -61,7 +61,7 @@ START_TEST (test_symlink)
|
|
here, but as /dev/mapper is root owned this is a non issue */
|
|
close (tmp_fd);
|
|
unlink (ln);
|
|
- char temp_disk_path[256];
|
|
+ char temp_disk_path[259];
|
|
int r = snprintf(temp_disk_path, sizeof temp_disk_path, "%s/%s",
|
|
cwd,
|
|
temporary_disk);
|
|
--
|
|
2.39.2
|
|
|