]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-smb.c
Convert some format pointers to "char *" from "u_char *", and some data
[tcpdump] / print-smb.c
index bb8e7aca7b44feea8d3a62238414d857bbd26ef8..ffdc99a037262dcba04dd32466a84109e3e3b473 100644 (file)
@@ -12,7 +12,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.21 2002-02-06 11:14:51 guy Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.22 2002-04-25 04:54:02 guy Exp $";
 #endif
 
 #include <stdio.h>
@@ -175,7 +175,7 @@ print_trans2(const u_char *words, const u_char *dat, const u_char *buf, const u_
     static struct smbfnsint *fn = &trans2_fns[0];
     const u_char *data, *param;
     const u_char *w = words + 1;
-    const u_char *f1 = NULL, *f2 = NULL;
+    const char *f1 = NULL, *f2 = NULL;
     int pcnt, dcnt;
 
     TCHECK(words[0]);
@@ -226,8 +226,8 @@ print_trans2(const u_char *words, const u_char *dat, const u_char *buf, const u_
     if (fn->descript.fn)
        (*fn->descript.fn)(param, data, pcnt, dcnt);
     else {
-       smb_fdata(param, f1 ? f1 : (u_char *)"Paramaters=\n", param + pcnt);
-       smb_fdata(data, f2 ? f2 : (u_char *)"Data=\n", data + dcnt);
+       smb_fdata(param, f1 ? f1 : "Parameters=\n", param + pcnt);
+       smb_fdata(data, f2 ? f2 : "Data=\n", data + dcnt);
     }
     return;
 trunc:
@@ -331,7 +331,7 @@ print_ipc(const u_char *param, int paramlen, const u_char *data, int datalen)
 static void
 print_trans(const u_char *words, const u_char *data1, const u_char *buf, const u_char *maxbuf)
 {
-    const u_char *f1, *f2, *f3, *f4;
+    const char *f1, *f2, *f3, *f4;
     const u_char *data, *param;
     const u_char *w = words + 1;
     int datalen, paramlen;
@@ -385,7 +385,7 @@ trunc:
 static void
 print_negprot(const u_char *words, const u_char *data, const u_char *buf, const u_char *maxbuf)
 {
-    u_char *f1 = NULL, *f2 = NULL;
+    const char *f1 = NULL, *f2 = NULL;
 
     TCHECK(words[0]);
     if (request)
@@ -420,7 +420,7 @@ static void
 print_sesssetup(const u_char *words, const u_char *data, const u_char *buf, const u_char *maxbuf)
 {
     int wcnt;
-    u_char *f1 = NULL, *f2 = NULL;
+    const char *f1 = NULL, *f2 = NULL;
 
     TCHECK(words[0]);
     wcnt = words[0];
@@ -764,7 +764,7 @@ print_smb(const u_char *buf, const u_char *maxbuf)
     TCHECK(words[0]);
 
     for (;;) {
-       const u_char *f1, *f2;
+       const char *f1, *f2;
        int wct;
        int bcc;
 
@@ -951,7 +951,7 @@ nbt_udp137_print(const u_char *data, int length)
     int name_trn_id, response, opcode, nm_flags, rcode;
     int qdcount, ancount, nscount, arcount;
     char *opcodestr;
-    const char *p;
+    const u_char *p;
     int total, i;
 
     TCHECK2(data[10], 2);
@@ -1080,14 +1080,14 @@ nbt_udp137_print(const u_char *data, int length)
                        p += 2;
                    }
                } else {
-                   print_data(p, min(rdlen, length - ((const u_char *)p - data)));
+                   print_data(p, min(rdlen, length - (p - data)));
                    p += rdlen;
                }
            }
        }
     }
 
-    if ((u_char*)p < maxbuf)
+    if (p < maxbuf)
        smb_fdata(p, "AdditionalData:\n", maxbuf);
 
 out: