Fix warnings from the Clang Static Analyzer.
[tinc] / src / tincd.c
index a2b3580..ed0cee9 100644 (file)
@@ -239,7 +239,8 @@ static bool parse_options(int argc, char **argv) {
                                        usage(true);
                                        return false;
                                }
-                               netname = strcmp(optarg, ".") != 0 ? xstrdup(optarg) : NULL;
+                               if(optarg && strcmp(optarg, "."))
+                                       netname = xstrdup(optarg);
                                break;
 
                        case 'o':                               /* option */