diff options
Diffstat (limited to 'src/test/test-copy.c')
-rw-r--r-- | src/test/test-copy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test-copy.c b/src/test/test-copy.c index bfe6cea41c..5f7b9e5ce8 100644 --- a/src/test/test-copy.c +++ b/src/test/test-copy.c @@ -52,8 +52,8 @@ static void test_copy_file_fd(void) { char in_fn[] = "/tmp/test-copy-file-fd-XXXXXX"; char out_fn[] = "/tmp/test-copy-file-fd-XXXXXX"; _cleanup_close_ int in_fd = -1, out_fd = -1; - char text[] = "boohoo\nfoo\n\tbar\n"; - char buf[64] = {0}; + const char *text = "boohoo\nfoo\n\tbar\n"; + char buf[64] = {}; log_info("%s", __func__); @@ -67,7 +67,7 @@ static void test_copy_file_fd(void) { assert_se(copy_file_fd(in_fn, out_fd, COPY_REFLINK) >= 0); assert_se(lseek(out_fd, SEEK_SET, 0) == 0); - assert_se(read(out_fd, buf, sizeof(buf)) == sizeof(text) - 1); + assert_se(read(out_fd, buf, sizeof buf) == (ssize_t) strlen(text)); assert_se(streq(buf, text)); unlink(in_fn); |