summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/smbutil.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2003-03-02 08:22:26 +0000
committerfenner <fenner@FreeBSD.org>2003-03-02 08:22:26 +0000
commit5f76ebca43302f98858e83a6212d9c610e939bad (patch)
treec244ceda18deb5fc8e576971e1e83b7b631f5219 /contrib/tcpdump/smbutil.c
parent24ede2d805a7ffac09999aafe7d4f285e45a6edd (diff)
downloadFreeBSD-src-5f76ebca43302f98858e83a6212d9c610e939bad.zip
FreeBSD-src-5f76ebca43302f98858e83a6212d9c610e939bad.tar.gz
Import tcpdump 3.7.2 (fudging for multi-DLT support) from
http://www.tcpdump.org/release/tcpdump-3.7.2.tar.gz
Diffstat (limited to 'contrib/tcpdump/smbutil.c')
-rw-r--r--contrib/tcpdump/smbutil.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/contrib/tcpdump/smbutil.c b/contrib/tcpdump/smbutil.c
index 756a8d2..84c6f33 100644
--- a/contrib/tcpdump/smbutil.c
+++ b/contrib/tcpdump/smbutil.c
@@ -12,7 +12,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.18 2002/01/17 04:38:29 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.18.2.3 2002/07/10 07:29:23 guy Exp $";
#endif
#include <sys/param.h>
@@ -26,7 +26,9 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef TIME_WITH_SYS_TIME
#include <time.h>
+#endif
#include "interface.h"
#include "extract.h"
@@ -336,7 +338,7 @@ write_bits(unsigned int val, char *fmt)
/* convert a UCS2 string into iso-8859-1 string */
static const char *
-unistr(const char *s, int *len)
+unistr(const u_char *s, int *len)
{
static char buf[1000];
int l=0;
@@ -352,8 +354,8 @@ unistr(const char *s, int *len)
/* maybe it isn't unicode - a cheap trick */
if (!use_unicode || (s[0] && s[1])) {
- *len = strlen(s) + 1;
- return s;
+ *len = strlen((const char *)s) + 1;
+ return (const char *)s;
}
*len = 0;
@@ -398,8 +400,11 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
case '{':
{
char bitfmt[128];
- char *p = strchr(++fmt, '}');
- int l = PTR_DIFF(p, fmt);
+ char *p;
+ int l;
+
+ p = strchr(++fmt, '}');
+ l = PTR_DIFF(p, fmt);
strncpy(bitfmt, fmt, l);
bitfmt[l] = 0;
fmt = p + 1;
@@ -413,7 +418,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
int l = atoi(fmt + 1);
buf += l;
fmt++;
- while (isdigit(*fmt))
+ while (isdigit((unsigned char)*fmt))
fmt++;
break;
}
@@ -527,7 +532,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
printf("%-*.*s", l, l, buf);
buf += l;
fmt++;
- while (isdigit(*fmt))
+ while (isdigit((unsigned char)*fmt))
fmt++;
break;
}
@@ -537,7 +542,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
while (l--)
printf("%02x", *buf++);
fmt++;
- while (isdigit(*fmt))
+ while (isdigit((unsigned char)*fmt))
fmt++;
break;
}
@@ -569,7 +574,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
break;
}
fmt++;
- while (isdigit(*fmt))
+ while (isdigit((unsigned char)*fmt))
fmt++;
break;
}
@@ -601,7 +606,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
}
printf("%s", t ? asctime(localtime(&t)) : "NULL\n");
fmt++;
- while (isdigit(*fmt))
+ while (isdigit((unsigned char)*fmt))
fmt++;
break;
}
OpenPOWER on IntegriCloud