After copying len(str) bytes of a string, the copy won't necessary have \0 terminator, that makes test_pipe_io_fixed() to fail. Use memcmp(). Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- test/stdout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/stdout.c b/test/stdout.c index 440ea20..ddc9eec 100644 --- a/test/stdout.c +++ b/test/stdout.c @@ -84,7 +84,7 @@ static int test_pipe_io_fixed(struct io_uring *ring) (unsigned long) cqe->user_data); goto err; } - if (cqe->user_data == 2 && strcmp(str, buffer)) { + if (cqe->user_data == 2 && memcmp(str, buffer, strlen(str))) { fprintf(stderr, "read data mismatch\n"); goto err; } -- 2.24.0