diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-16 12:54:34 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-16 12:54:34 -0400 |
| commit | fdad37bc1854a973424459026cc32698ff5fe532 (patch) | |
| tree | 7a4e7301d4ecb5c8ef4f5a81e6d20aed13638394 /tests/test_utils.c | |
| parent | dc6b871b419159097c272fe21cdef6acece40a99 (diff) | |
| download | stasis-fdad37bc1854a973424459026cc32698ff5fe532.tar.gz | |
Convert more strcpy to strn variant
Diffstat (limited to 'tests/test_utils.c')
| -rw-r--r-- | tests/test_utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |
