summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-11-18 12:32:24 +0100
committerLennart Poettering <lennart@poettering.net>2025-01-17 17:02:07 +0100
commitce2ef96c2b8ad7569a288a1ecc5aaf06bf34bd07 (patch)
tree77686543835f5c48055d6a2377a066e8795c02f0 /src/test
parentmkosi: update fedora commit reference (diff)
downloadsystemd-ce2ef96c2b8ad7569a288a1ecc5aaf06bf34bd07.tar.xz
systemd-ce2ef96c2b8ad7569a288a1ecc5aaf06bf34bd07.zip
hexdump: if size is SIZE_MAX, use strlen()
Similar how we do this as various places: if SIZE_MAX is specified as size determine the size automatically via strlen().
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-hexdecoct.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
index 5c39fc7cc2..e5121d148e 100644
--- a/src/test/test-hexdecoct.c
+++ b/src/test/test-hexdecoct.c
@@ -503,11 +503,15 @@ TEST(hexdump) {
hexdump(stdout, NULL, 0);
hexdump(stdout, "", 0);
+ hexdump(stdout, "", SIZE_MAX);
hexdump(stdout, "", 1);
hexdump(stdout, "x", 1);
+ hexdump(stdout, "x", SIZE_MAX);
hexdump(stdout, "x", 2);
hexdump(stdout, "foobar", 7);
+ hexdump(stdout, "foobar", SIZE_MAX);
hexdump(stdout, "f\nobar", 7);
+ hexdump(stdout, "f\nobar", SIZE_MAX);
hexdump(stdout, "xxxxxxxxxxxxxxxxxxxxyz", 23);
for (i = 0; i < ELEMENTSOF(data); i++)