[10/10] zdtm/socket-tcp-fin-wait1: Use array index fro TEST_MSG

Submitted by Dmitry Safonov on Nov. 21, 2019, 9:56 p.m.

Details

Message ID 20191121215643.275552-11-dima@arista.com
State Accepted
Series "build: Test and support armv7 cross"
Commit d6a428d5756429375106b75cbc643c894e183ae1
Headers show

Commit Message

Dmitry Safonov Nov. 21, 2019, 9:56 p.m.
Fixes the following compile-error:
>  CC        socket-tcp-fin-wait1.o
> socket-tcp-fin-wait1.c:144:26: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
>                 if (write(fd, TEST_MSG + 2, sizeof(TEST_MSG) - 2) != sizeof(TEST_MSG) - 2) {
>                               ~~~~~~~~~^~~
> socket-tcp-fin-wait1.c:144:26: note: use array indexing to silence this warning
>                 if (write(fd, TEST_MSG + 2, sizeof(TEST_MSG) - 2) != sizeof(TEST_MSG) - 2) {
>                                        ^
>                               &        [  ]
> 1 error generated.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 test/zdtm/static/socket-tcp-fin-wait1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/socket-tcp-fin-wait1.c b/test/zdtm/static/socket-tcp-fin-wait1.c
index 6c7cc93e5644..50da9c152897 100644
--- a/test/zdtm/static/socket-tcp-fin-wait1.c
+++ b/test/zdtm/static/socket-tcp-fin-wait1.c
@@ -141,7 +141,7 @@  int main(int argc, char **argv)
 			return 1;
 		}
 
-		if (write(fd, TEST_MSG + 2, sizeof(TEST_MSG) - 2) != sizeof(TEST_MSG) - 2) {
+		if (write(fd, &TEST_MSG[2], sizeof(TEST_MSG) - 2) != sizeof(TEST_MSG) - 2) {
 			pr_err("write");
 			return 1;
 		}