]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-03-08 Paul Jakma <paul.jakma@sun.com>
authorpaul <paul>
Tue, 8 Mar 2005 16:00:12 +0000 (16:00 +0000)
committerpaul <paul>
Tue, 8 Mar 2005 16:00:12 +0000 (16:00 +0000)
* command.c: (no_banner_motd_cmd) use XFREE.
* vty.c: (vty_hello) fix the indentation and comment.

lib/ChangeLog
lib/command.c
lib/vty.c

index 03ca581f37824c4643563825de7e3be383e2ed1a..1092844f76715eb02e75b5d804424ea639345c04 100644 (file)
@@ -1,6 +1,7 @@
 2005-03-08 Paul Jakma <paul.jakma@sun.com>
 
        * command.c: (banner_motd_file_cmd) use XSTRDUP/XFREE.
+         (no_banner_motd_cmd) use XFREE.
          (cmd_describe_command_real) sign compile warning fix
          (cmd_complete_command_real) ditto.
          (config_list_cmd) Don't list hidden or deprecated commands,
index d83ebe1232daf2f35fb5a296cea5fa6ee11b0211..cf7f46b9a22f22b135b60f382109f62fa786ecb1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   $Id: command.c,v 1.40 2005/03/08 15:56:42 paul Exp $
+   $Id: command.c,v 1.41 2005/03/08 16:00:12 paul Exp $
 
    Command interpreter routine for virtual terminal [aka TeletYpe]
    Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
@@ -3437,7 +3437,8 @@ DEFUN (no_banner_motd,
        "Strings for motd\n")
 {
   host.motd = NULL;
-  if (host.motdfile) free(host.motdfile);
+  if (host.motdfile) 
+    XFREE (MTYPE_TMP, host.motdfile);
   host.motdfile = NULL;
   return CMD_SUCCESS;
 }
index 2ea24b8e7cda699a1acb182240f90c08146afcc9..89a941cab8b6300b8a8a24bdd0de0103cd7c40cc 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -220,19 +220,19 @@ vty_hello (struct vty *vty)
     {
       FILE *f;
       char buf[4096];
-      
+
       f = fopen (host.motdfile, "r");
       if (f)
        {
          while (fgets (buf, sizeof (buf), f))
            {
              char *s;
-             /* work backwards and squash all isspace() chars
-              * we want nul terminated for vty_out */
-             for (s = buf+strlen(buf); (s > buf) && isspace(*(s-1)); s--);
-               *s = '\0';
-              vty_out (vty, "%s%s", buf, VTY_NEWLINE);
-            }
+             /* work backwards to ignore trailling isspace() */
+             for (s = buf + strlen (buf); (s > buf) && isspace (*(s - 1));
+                  s--);
+             *s = '\0';
+             vty_out (vty, "%s%s", buf, VTY_NEWLINE);
+           }
          fclose (f);
        }
       else