Commit 48514a22 authored by Shuah Khan's avatar Shuah Khan Committed by David S. Miller

selftests: net: af_unix: Fix incorrect args in test result msg

Fix the args to fprintf(). Splitting the message ends up passing
incorrect arg for "sigurg %d" and an extra arg overall. The test
result message ends up incorrect.

test_unix_oob.c: In function ‘main’:
test_unix_oob.c:274:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘char *’ [-Wformat=]
  274 |   fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ",
      |                                          ~^
      |                                           |
      |                                           int
      |                                          %s
  275 |   "atmark %d\n", signal_recvd, len, oob, atmark);
      |   ~~~~~~~~~~~~~
      |   |
      |   char *
test_unix_oob.c:274:19: warning: too many arguments for format [-Wformat-extra-args]
  274 |   fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ",
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 029497e6
...@@ -271,8 +271,9 @@ main(int argc, char **argv) ...@@ -271,8 +271,9 @@ main(int argc, char **argv)
read_oob(pfd, &oob); read_oob(pfd, &oob);
if (!signal_recvd || len != 127 || oob != '%' || atmark != 1) { if (!signal_recvd || len != 127 || oob != '%' || atmark != 1) {
fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ", fprintf(stderr,
"atmark %d\n", signal_recvd, len, oob, atmark); "Test 3 failed, sigurg %d len %d OOB %c atmark %d\n",
signal_recvd, len, oob, atmark);
die(1); die(1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment