]> The Tcpdump Group git mirrors - tcpdump/commitdiff
use safeputchar() instead of cook up on its own.
authoritojun <itojun>
Sun, 28 Jan 2001 08:06:06 +0000 (08:06 +0000)
committeritojun <itojun>
Sun, 28 Jan 2001 08:06:06 +0000 (08:06 +0000)
print-decnet.c
print-isakmp.c
print-tcp.c
smbutil.c

index 6f8facce5c602aac2caf226e51a920c7c0db504d..bb5f075f801d2745a531424906a6ed04e5f743c0 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.31 2001-01-20 07:22:24 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.32 2001-01-28 08:06:06 itojun Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -768,10 +768,7 @@ pdata(u_char *dp, u_int maxlen)
 
        while (x-- > 0) {
            c = *dp++;
-           if (isprint(c))
-               putchar(c);
-           else
-               printf("\\%o", c & 0xFF);
+           safeputchar(c);
        }
 }
 #endif
index d6fa40d7e5ca12e98341d209ca25de6463f0e32f..9380cbd4f665865c7855e48a0875514543cc8f5a 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.26 2000-12-12 09:20:26 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.27 2001-01-28 08:06:07 itojun Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -702,12 +702,8 @@ isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
                    {
                        int i;
                        printf(" len=%d ", len);
-                       for (i = 0; i < len; i++) {
-                               if (isprint(data[i]))
-                                       printf("%c", data[i]);
-                               else
-                                       printf("\\%03o", data[i]);
-                       }
+                       for (i = 0; i < len; i++)
+                               safeputchar(data[i]);
                        len = 0;
                        break;
                    }
index 9cc707fc9297ae89745ef0b95c8fe6f494850386..1ea138edba8f57eab756a45746bc3ca5c9d6037f 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.81 2000-12-23 20:55:22 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.82 2001-01-28 08:06:07 itojun Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -697,10 +697,7 @@ print_tcp_rst_data(register const u_char *sp, u_int length)
        putchar(' ');
        while (length-- && sp <= snapend) {
                c = *sp++;
-               if (isprint(c))
-                       putchar(c);
-               else
-                       putchar('.');
+               safeputchar(c);
        }
        putchar(']');
 }
index 1af60106a4a61c258d27ee11763c46f7fb825550..91743a263af9453c14c326908b3d1502a037938e 100644 (file)
--- a/smbutil.c
+++ b/smbutil.c
@@ -11,7 +11,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.12 2000-12-04 00:35:45 guy Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.13 2001-01-28 08:06:08 itojun Exp $";
 #endif
 
 #include <sys/param.h>
@@ -234,7 +234,7 @@ static void print_asc(const unsigned char *buf,int len)
 {
   int i;
   for (i=0;i<len;i++)
-    printf("%c",isprint(buf[i])?buf[i]:'.');
+    safeputchar(buf[i]);
 }
 
 static char *name_type_str(int name_type)