summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-06-16 22:42:01 +0300
committerJens Axboe <axboe@kernel.dk>2020-06-16 13:47:13 -0600
commitc7748f9f270d16b602dd344a1cf4e3ce6a8c8bed (patch)
tree46fc1c782faa76ada91d052fcf66bd46f71cc153 /test
parent0715636bdbcbc341caecd71f714fed7f0fc98d6f (diff)
downloadliburing-c7748f9f270d16b602dd344a1cf4e3ce6a8c8bed.tar.gz
liburing-c7748f9f270d16b602dd344a1cf4e3ce6a8c8bed.tar.bz2
test/stdout: fix strcmp non-\0 string
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@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r--test/stdout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/stdout.c b/test/stdout.c
index 1719a1b..25585dc 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;
}