From 3c0df798ff952ba5c2915788b7671c399f52d270 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 13 Oct 2016 11:16:23 +0300 Subject: [PATCH] Eliminate 'unnecessary comparison of static strings' cppcheck warning * tools/if_mach.c (main): Replace strcmp(x, "")!=0 with strlen(x)>0. --- tools/if_mach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/if_mach.c b/tools/if_mach.c index 94053a66..f99d1649 100644 --- a/tools/if_mach.c +++ b/tools/if_mach.c @@ -9,7 +9,7 @@ int main(int argc, char **argv) { if (argc < 4) goto Usage; if (strcmp(MACH_TYPE, argv[1]) != 0) return(0); - if (strcmp(OS_TYPE, "") != 0 && strcmp(argv[2], "") != 0 + if (strlen(OS_TYPE) > 0 && strlen(argv[2]) > 0 && strcmp(OS_TYPE, argv[2]) != 0) return(0); fprintf(stderr, "^^^^Starting command^^^^\n"); fflush(stdout); -- 2.40.0