]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
limit printing of excess data in log to 32 bytes
[ppp.git] / pppd / main.c
index 214af7723cc7f708e67340584cdce7d9ff5b3a12..2141879090fc378c770119c08e03c41700ef3b20 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.52 1999/01/19 23:59:39 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.54 1999/03/02 05:36:42 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -828,7 +828,7 @@ close_tty()
     restore_tty(ttyfd);
 
     if (tty_mode != (mode_t) -1) {
-       if (fchmod(devnam, tty_mode) != 0) {
+       if (fchmod(ttyfd, tty_mode) != 0) {
            /* XXX if devnam is a symlink, this will change the link */
            chmod(devnam, tty_mode);
        }
@@ -1378,10 +1378,12 @@ format_packet(p, len, printer, arg)
        }
     }
 
-    for (; len > 0; --len) {
+    for (i = 0; i < len && i < 32; ++i) {
        GETCHAR(x, p);
        printer(arg, " %.2x", x);
     }
+    if (i < len)
+       printer(arg, " ...");
 }
 
 static void