diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-17 12:05:20 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-17 12:05:20 -0400 |
| commit | 0c6bcfb345075dc042b139bcdfbc11cd862c7258 (patch) | |
| tree | 6dd2c632663f94fb8b390c05b8ed51ad4e5f5872 /tests/test_utils.c | |
| parent | 90cbf865cb6e88d5db6484040dc4dc885f88caed (diff) | |
| download | stasis-0c6bcfb345075dc042b139bcdfbc11cd862c7258.tar.gz | |
Fix incorrect usage of maxlen argument in snprintf calls
Diffstat (limited to 'tests/test_utils.c')
| -rw-r--r-- | tests/test_utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_utils.c b/tests/test_utils.c index 79bca43..7361139 100644 --- a/tests/test_utils.c +++ b/tests/test_utils.c @@ -147,7 +147,9 @@ void test_xmkstemp() { char buf[100] = {0}; tempfp = fopen(tempfile, "r"); - fgets(buf, sizeof(buf) - 1, tempfp); + const char *line = fgets(buf, sizeof(buf) - 1, tempfp); + STASIS_ASSERT_FATAL(line != NULL, "file should contain data written earlier"); + STASIS_ASSERT(strcmp(line, buf) == 0, "file should contain the correct data"); fclose(tempfp); STASIS_ASSERT(strcmp(buf, data) == 0, "data written to temp file is incorrect"); |
