]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/command.c
Merge pull request #11469 from donaldsharp/fdev2
[mirror_frr.git] / lib / command.c
index 1989668bf09fb52902a395f1c7f75278d076f459..cbecc815741e3e94bb4cd39f3be3407aaddcb813 100644 (file)
@@ -315,7 +315,7 @@ void _install_element(enum node_type ntype, const struct cmd_element *cmd)
                return;
        }
 
-       assert(hash_get(cnode->cmd_hash, (void *)cmd, hash_alloc_intern));
+       (void)hash_get(cnode->cmd_hash, (void *)cmd, hash_alloc_intern);
 
        if (cnode->graph_built || !defer_cli_tree) {
                struct graph *graph = graph_new();
@@ -429,7 +429,6 @@ static char *zencrypt(const char *passwd)
 {
        char salt[6];
        struct timeval tv;
-       char *crypt(const char *, const char *);
 
        gettimeofday(&tv, 0);
 
@@ -445,11 +444,15 @@ static bool full_cli;
 /* This function write configuration of this host. */
 static int config_write_host(struct vty *vty)
 {
-       if (cmd_hostname_get())
-               vty_out(vty, "hostname %s\n", cmd_hostname_get());
+       const char *name;
 
-       if (cmd_domainname_get())
-               vty_out(vty, "domainname %s\n", cmd_domainname_get());
+       name = cmd_hostname_get();
+       if (name && name[0] != '\0')
+               vty_out(vty, "hostname %s\n", name);
+
+       name = cmd_domainname_get();
+       if (name && name[0] != '\0')
+               vty_out(vty, "domainname %s\n", name);
 
        /* The following are all configuration commands that are not sent to
         * watchfrr.  For instance watchfrr is hardcoded to log to syslog so