diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-16 12:57:44 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-16 12:57:44 -0400 |
| commit | fa60a725478ca8ebade66a9031488501eb557820 (patch) | |
| tree | 851c57653e138dc4597af0059365ee13f765e4fb | |
| parent | fdad37bc1854a973424459026cc32698ff5fe532 (diff) | |
| download | stasis-fa60a725478ca8ebade66a9031488501eb557820.tar.gz | |
Remove sizeof call
| -rw-r--r-- | tests/test_str.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/test_str.c b/tests/test_str.c index 5679078..85c8fb9 100644 --- a/tests/test_str.c +++ b/tests/test_str.c @@ -317,9 +317,8 @@ void test_lstrip() { STASIS_ASSERT(lstrip(NULL) == NULL, "incorrect return type"); for (size_t i = 0; i < sizeof(tc) / sizeof(*tc); i++) { char *buf = calloc(255, sizeof(*buf)); - char *result; - strncpy(buf, tc[i].data, sizeof(buf) - 1); - result = lstrip(buf); + strncpy(buf, tc[i].data, 254); + char *result = lstrip(buf); STASIS_ASSERT(strcmp(result ? result : "", tc[i].expected) == 0, "incorrect strip-from-left"); guard_free(buf); } |
