From: Anton Moryakov Date: Sat, 19 Jul 2025 16:31:22 +0000 (+0300) Subject: misc: ss.c: fix logical error in main function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27d11a81197c60a409dda84de01cf0aa841530f9;p=thirdparty%2Fiproute2.git misc: ss.c: fix logical error in main function 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 Acked-by: Stephen Hemminger Signed-off-by: David Ahern --- diff --git a/misc/ss.c b/misc/ss.c index 6d597650..989e168a 100644 --- 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); }