diff options
Diffstat (limited to 'tests/test_system.c')
| -rw-r--r-- | tests/test_system.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_system.c b/tests/test_system.c index 2271e13..cdef618 100644 --- a/tests/test_system.c +++ b/tests/test_system.c @@ -4,7 +4,7 @@ static int ascii_file_contains(const char *filename, const char *value) { int result = -1; char *contents = stasis_testing_read_ascii(filename); if (!contents) { - perror(filename); + SYSERROR("unable to read %s: %s", filename, strerror(errno)); return result; } result = strcmp(contents, value) == 0; @@ -54,7 +54,7 @@ void test_shell_safe_verify_restrictions() { char cmd[PATH_MAX] = {0}; memset(&proc, 0, sizeof(proc)); - sprintf(cmd, "true%c false", invalid_chars[i]); + snprintf(cmd, sizeof(cmd), "true%c false", invalid_chars[i]); shell_safe(&proc, cmd); STASIS_ASSERT(proc.returncode == -1, "expected a negative result due to intentional error"); } |
