summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-08-29 01:33:00 +0000
committerTim Potter <tpot@samba.org>2003-08-29 01:33:00 +0000
commit48cb8f8d5f41045bf405047fbb5db6a29935a342 (patch)
tree81344f5a0df47bd0ef472ecd2dbc53d8e97aab04 /source3
parentd425729fd94c3fde58c9d95b28d44e2fe53abac4 (diff)
downloadsamba-48cb8f8d5f41045bf405047fbb5db6a29935a342.tar.gz
samba-48cb8f8d5f41045bf405047fbb5db6a29935a342.tar.bz2
samba-48cb8f8d5f41045bf405047fbb5db6a29935a342.zip
Fix some compiler warnings.
(This used to be commit f566de0541373fab97caa6b0f574f79e68ae74dc)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/log2pcaphex.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/source3/utils/log2pcaphex.c b/source3/utils/log2pcaphex.c
index b3a34281a8..7c429c326b 100644
--- a/source3/utils/log2pcaphex.c
+++ b/source3/utils/log2pcaphex.c
@@ -120,9 +120,9 @@ void print_pcap_packet(FILE *out, unsigned char *data, long length, long caplen)
void print_hex_packet(FILE *out, unsigned char *data, long length)
{
- long i,cur = 0;int tmp;
+ long i,cur = 0;
while(cur < length) {
- fprintf(out, "%06X ", cur);
+ fprintf(out, "%06lX ", cur);
for(i = cur; i < length && i < cur + 16; i++) {
fprintf(out, "%02x ", data[i]);
}
@@ -159,7 +159,7 @@ void read_log_msg(FILE *in, unsigned char **_buffer, long *buffersize, long *dat
{
unsigned char *buffer;
int tmp; long i;
- assert(fscanf(in, " size=%d\n", buffersize));
+ assert(fscanf(in, " size=%ld\n", buffersize));
*buffersize+=4; /* for netbios */
buffer = malloc(*buffersize);
memset(buffer, 0, *buffersize);
@@ -188,7 +188,7 @@ void read_log_msg(FILE *in, unsigned char **_buffer, long *buffersize, long *dat
}
*data_offset = smb_vwv+buffer[smb_wct]*2;
- assert(fscanf(in, " smb_bcc=%d\n", data_length)); buffer[(*data_offset)] = *data_length;
+ assert(fscanf(in, " smb_bcc=%ld\n", data_length)); buffer[(*data_offset)] = *data_length;
(*data_offset)+=2;
*_buffer = buffer;
}
@@ -202,15 +202,15 @@ long read_log_data(FILE *in, unsigned char *buffer, long data_length)
if(i != 0) { /* Read data after each line */
assert(fscanf(in, "%8s %8s", real[0], real[1]) == 2);
}
- ret = fscanf(in, " [%03X]", &addr);
+ ret = fscanf(in, " [%03lX]", &addr);
if(!ret) {
- if(!quiet)fprintf(stderr, "Only first %d bytes are logged, packet trace will be incomplete\nTry a higher log level\n", i);
+ if(!quiet)fprintf(stderr, "Only first %ld bytes are logged, packet trace will be incomplete\nTry a higher log level\n", i);
return i-1;
}
assert(addr == i);
}
- if(!fscanf(in, "%02X", &tmp)) {
- if(!quiet)fprintf(stderr, "Only first %d bytes are logged, packet trace will be incomplete\nTry a higher log level\n", i-1);
+ if(!fscanf(in, "%02lX", &tmp)) {
+ if(!quiet)fprintf(stderr, "Only first %ld bytes are logged, packet trace will be incomplete\nTry a higher log level\n", i-1);
return i-1;
}
buffer[i] = tmp;
@@ -223,13 +223,11 @@ int main (int argc, char **argv)
const char *infile, *outfile;
FILE *out, *in;
int opt;
- int c;
poptContext pc;
char buffer[4096];
long data_offset, data_length;
long data_bytes_read;
int in_packet = 0;
- int i;
struct poptOption long_options[] = {
POPT_AUTOHELP
{ "quiet", 'q', POPT_ARG_NONE, &quiet, 0, "Be quiet, don't output warnings" },