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_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_utils.c') diff --git a/tests/test_utils.c b/tests/test_utils.c index 1ad2335..79bca43 100644 --- a/tests/test_utils.c +++ b/tests/test_utils.c @@ -65,7 +65,7 @@ void test_fix_tox_conf() { if (fp) { fprintf(fp, "%s", data); fclose(fp); - STASIS_ASSERT(fix_tox_conf(filename, &result) == 0, "fix_tox_conf failed"); + STASIS_ASSERT(fix_tox_conf(filename, &result, PATH_MAX) == 0, "fix_tox_conf failed"); } else { STASIS_ASSERT(false, "writing mock tox.ini failed"); } @@ -308,7 +308,7 @@ void test_path_dirname() { const char *input = data[i]; const char *expected = data[i + 1]; char tmp[PATH_MAX] = {0}; - strcpy(tmp, input); + strncpy(tmp, input, sizeof(tmp) - 1); char *result = path_dirname(tmp); STASIS_ASSERT(strcmp(expected, result) == 0, NULL); -- cgit