[PATCH] tests: fix warning in tst-symlink

7 views
Skip to first unread message

Nadav Har'El

unread,
Nov 28, 2019, 3:35:59 AM11/28/19
to osv...@googlegroups.com, Nadav Har'El
The compiler correctly warns that we can't fill 4097 bytes of an array
size 4096 (=PATH_MAX). I don't know why this code had 4097 in the first
place.

The test still passes with this fix, and the warning is gone.

Refs #976.

Signed-off-by: Nadav Har'El <n...@scylladb.com>
---
tests/tst-symlink.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/tst-symlink.cc b/tests/tst-symlink.cc
index 78100ea0..0eff52f3 100644
--- a/tests/tst-symlink.cc
+++ b/tests/tst-symlink.cc
@@ -269,7 +269,7 @@ int main(int argc, char **argv)
report(rc < 0, "symlink");
report(error == ENAMETOOLONG, "ENAMETOOLONG expected 1");

- fill_buf(path, 4097);
+ fill_buf(path, PATH_MAX);
unlink(N1);
rc = symlink(path, N1);
error = errno;
--
2.21.0

Commit Bot

unread,
Nov 28, 2019, 10:02:33 AM11/28/19
to osv...@googlegroups.com, Nadav Har'El
From: Nadav Har'El <n...@scylladb.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

tests: fix warning in tst-symlink

The compiler correctly warns that we can't fill 4097 bytes of an array
size 4096 (=PATH_MAX). I don't know why this code had 4097 in the first
place.

The test still passes with this fix, and the warning is gone.

Refs #976.

Signed-off-by: Nadav Har'El <n...@scylladb.com>
Message-Id: <201911280835...@scylladb.com>

---
diff --git a/tests/tst-symlink.cc b/tests/tst-symlink.cc
Reply all
Reply to author
Forward
0 new messages