From 8dfc361023276ee88170a2555f40d68a8ef57535 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 16 Apr 2026 11:50:20 -0400 Subject: test_relocation: add test for tpl_render_to_file --- tests/test_relocation.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/test_relocation.c') diff --git a/tests/test_relocation.c b/tests/test_relocation.c index a6c33f2..8a9beb6 100644 --- a/tests/test_relocation.c +++ b/tests/test_relocation.c @@ -16,7 +16,10 @@ void test_replace_text() { char input[BUFSIZ] = {0}; strcpy(input, test_string); + printf("input: %s\n", input); + printf("target: %s\n", target); STASIS_ASSERT(replace_text(input, target, "^^^", 0) == 0, "string replacement failed"); + printf("result: %s\n\n", input); STASIS_ASSERT(strcmp(input, expected) == 0, "unexpected replacement"); } -- cgit From fdad37bc1854a973424459026cc32698ff5fe532 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 16 Apr 2026 12:54:34 -0400 Subject: Convert more strcpy to strn variant --- tests/test_relocation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_relocation.c') diff --git a/tests/test_relocation.c b/tests/test_relocation.c index 8a9beb6..69142dc 100644 --- a/tests/test_relocation.c +++ b/tests/test_relocation.c @@ -14,7 +14,7 @@ void test_replace_text() { const char *target = targets[i]; const char *expected = targets[i + 1]; char input[BUFSIZ] = {0}; - strcpy(input, test_string); + strncpy(input, test_string, sizeof(input) - 1); printf("input: %s\n", input); printf("target: %s\n", target); -- cgit