]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: argv fixes, XFREE -> free, rm decl in matcher
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 22 Sep 2016 20:26:07 +0000 (20:26 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 22 Sep 2016 20:26:07 +0000 (20:26 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command.c
lib/command_match.c

index 9cdf0a5ff0dc51628e4b81cd228ad3d4a7f9e23d..680d32b03e03b94d594655bfa3b879161bf44401 100644 (file)
@@ -2005,13 +2005,13 @@ DEFUN (banner_motd_file,
        "Banner from a file\n"
        "Filename\n")
 {
-  int cmd = cmd_banner_motd_file (argv[3]->arg);
+  const char *filename = argv[3]->arg;
+  int cmd = cmd_banner_motd_file (filename);
 
   if (cmd == CMD_ERR_NO_FILE)
-    vty_out (vty, "%s does not exist", argv[3]->arg);
+    vty_out (vty, "%s does not exist", filename);
   else if (cmd == CMD_WARNING)
-    vty_out (vty, "%s must be in %s",
-             argv[0], SYSCONFDIR);
+    vty_out (vty, "%s must be in %s", filename, SYSCONFDIR);
 
   return cmd;
 }
@@ -2230,20 +2230,19 @@ del_cmd_token (struct cmd_token *token)
   if (!token) return;
 
   if (token->text)
-    XFREE (MTYPE_CMD_TOKENS, token->text);
+    free (token->text);
   if (token->desc)
-    XFREE (MTYPE_CMD_TOKENS, token->desc);
+    free (token->desc);
   if (token->arg)
-    XFREE (MTYPE_CMD_TOKENS, token->arg);
+    free (token->arg);
 
-  XFREE (MTYPE_CMD_TOKENS, token);
+  free (token);
 }
 
 struct cmd_token *
 copy_cmd_token (struct cmd_token *token)
 {
   struct cmd_token *copy = new_cmd_token (token->type, NULL, NULL);
-  copy->value = token->value;
   copy->max   = token->max;
   copy->min   = token->min;
   copy->text  = token->text ? XSTRDUP (MTYPE_CMD_TOKENS, token->text) : NULL;
@@ -2257,9 +2256,9 @@ void
 del_cmd_element(struct cmd_element *cmd)
 {
   if (!cmd) return;
-  XFREE (MTYPE_CMD_TOKENS, cmd->string);
-  XFREE (MTYPE_CMD_TOKENS, cmd->doc);
-  XFREE (MTYPE_CMD_TOKENS, cmd);
+  free ((char *) cmd->string);
+  free ((char *) cmd->doc);
+  free (cmd);
 }
 
 struct cmd_element *
index 03efa93e045131a94b9940efab9d3c41810cbede..aa961d35145131b9f94179119ffd914748f707c3 100644 (file)
@@ -77,9 +77,6 @@ match_range (struct cmd_token *, const char *);
 static enum match_type
 match_word (struct cmd_token *, const char *);
 
-static enum match_type
-match_number (struct cmd_token *, const char *);
-
 static enum match_type
 match_variable (struct cmd_token *, const char *);