2005-03-08 Paul Jakma <paul.jakma@sun.com>
* command.c: (no_banner_motd_cmd) use XFREE.
* vty.c: (vty_hello) fix the indentation and comment.
diff --git a/lib/vty.c b/lib/vty.c
index 2ea24b8..89a941c 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -220,19 +220,19 @@
{
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