]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
misc: ss.c: fix logical error in main function
authorAnton Moryakov <ant.v.moryakov@gmail.com>
Sat, 19 Jul 2025 16:31:22 +0000 (19:31 +0300)
committerDavid Ahern <dsahern@kernel.org>
Tue, 29 Jul 2025 23:12:08 +0000 (23:12 +0000)
In the line if (!dump_tcpdiag) { there was a logical error
in checking the descriptor, which the static analyzer complained
about (this action is always false)

fixed by replacing !dump_tcpdiag with !dump_fp

Reported-by: SVACE static analyzer
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
misc/ss.c

index 6d5976501467842b1681d7dfc1ca56cc1b4a98d5..989e168ae35026249ccec0e2d4a3df07b0438c7b 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -6228,7 +6228,7 @@ int main(int argc, char *argv[])
                }
                if (dump_tcpdiag[0] != '-') {
                        dump_fp = fopen(dump_tcpdiag, "w");
-                       if (!dump_tcpdiag) {
+                       if (!dump_fp) {
                                perror("fopen dump file");
                                exit(-1);
                        }