--- trunk/darkstattype.c 2014/03/21 16:03:12 11 +++ trunk/darkstattype.c 2014/03/21 16:59:56 13 @@ -290,7 +290,7 @@ void decode_host_header_v1(void) ipv4address[3] = read8u(); print_indentation(); - printf("IPv4 address %d.%d.%d.%d\n", + printf("IPv4 address %u.%u.%u.%u\n", ipv4address[0], ipv4address[1], ipv4address[2], ipv4address[3]); macaddress[0] = read8u(); @@ -306,7 +306,7 @@ void decode_host_header_v1(void) hostnamelen = read8u(); print_indentation(); - printf("Hostname length %d\n", hostnamelen); + printf("Hostname length %u\n", hostnamelen); for (i = 0; i < hostnamelen; i++) { hostname[i] = read8u(); @@ -373,7 +373,7 @@ void decode_host_header_v2(void) ipv4address[3] = read8u(); print_indentation(); - printf("IPv4 address %d.%d.%d.%d\n", + printf("IPv4 address %u.%u.%u.%u\n", ipv4address[0], ipv4address[1], ipv4address[2], ipv4address[3]); if (follow_specification == true) { @@ -416,7 +416,7 @@ void decode_host_header_v2(void) hostnamelen = read8u(); print_indentation(); - printf("Hostname length %d\n", hostnamelen); + printf("Hostname length %u\n", hostnamelen); for (i = 0; i < hostnamelen; i++) { hostname[i] = read8u(); @@ -489,32 +489,32 @@ void decode_host_header_v3(void) ipv4address[3] = read8u(); print_indentation(); - printf("IPv4 address %d.%d.%d.%d\n", + printf("IPv4 address %u.%u.%u.%u\n", ipv4address[0], ipv4address[1], ipv4address[2], ipv4address[3]); } // if else if (addressfamily == 0x06) { // IPv6 address print_indentation(); printf("IPv6 address family (0x%02x)\n", addressfamily); - ipv6address[ 0] = read16u(); - ipv6address[ 1] = read16u(); - ipv6address[ 2] = read16u(); - ipv6address[ 3] = read16u(); - ipv6address[ 4] = read16u(); - ipv6address[ 5] = read16u(); - ipv6address[ 6] = read16u(); - ipv6address[ 7] = read16u(); + ipv6address[0] = read16u(); + ipv6address[1] = read16u(); + ipv6address[2] = read16u(); + ipv6address[3] = read16u(); + ipv6address[4] = read16u(); + ipv6address[5] = read16u(); + ipv6address[6] = read16u(); + ipv6address[7] = read16u(); print_indentation(); printf("IPv6 address %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", - ipv6address[ 0], - ipv6address[ 1], - ipv6address[ 2], - ipv6address[ 3], - ipv6address[ 4], - ipv6address[ 5], - ipv6address[ 6], - ipv6address[ 7]); + ipv6address[0], + ipv6address[1], + ipv6address[2], + ipv6address[3], + ipv6address[4], + ipv6address[5], + ipv6address[6], + ipv6address[7]); } // else if else { // unknown address family fprintf(stderr, "%s:%s:%ld: unknown address family = 0x%x, neither 0x%x nor 0x%x\n", progname, filename, ftell(file), addressfamily, 0x04, 0x06); @@ -561,7 +561,7 @@ void decode_host_header_v3(void) hostnamelen = read8u(); print_indentation(); - printf("Hostname length %d\n", hostnamelen); + printf("Hostname length %u\n", hostnamelen); for (i = 0; i < hostnamelen; i++) { hostname[i] = read8u(); @@ -609,22 +609,22 @@ void decode_protos_data(void) { unsigned char ipprotocount; - unsigned char u; + unsigned char i; ipprotocount = read8u(); print_indentation(); - printf("IP Proto count %d\n", ipprotocount); + printf("IP Proto count %u\n", ipprotocount); indent(); - for (u = 0; u < ipprotocount; u++) { + for (i = 0; i < ipprotocount; i++) { unsigned char proto; unsigned long in; unsigned long out; print_indentation(); - printf("Protocol #%u of %u:\n", u + 1, ipprotocount); + printf("Protocol #%u of %u:\n", i + 1, ipprotocount); proto = read8u(); @@ -657,7 +657,7 @@ void decode_tcp_data(void) tcpprotocount = read16u(); print_indentation(); - printf("TCP proto count %d\n", tcpprotocount); + printf("TCP proto count %u\n", tcpprotocount); indent(); @@ -670,7 +670,7 @@ void decode_tcp_data(void) port = read16u(); print_indentation(); - printf("Port %d:\n", port); + printf("Port %u:\n", port); syn = read64u(); @@ -703,7 +703,7 @@ void decode_udp_data(void) udpprotocount = read16u(); print_indentation(); - printf("UDP proto count %d\n", udpprotocount); + printf("UDP proto count %u\n", udpprotocount); indent(); @@ -715,7 +715,7 @@ void decode_udp_data(void) port = read16u(); print_indentation(); - printf("Port %d:\n", port); + printf("Port %u:\n", port); in = read64u(); @@ -755,7 +755,7 @@ void decode_graph_db_v1(void) unsigned int j; print_indentation(); - printf("Graph #%d of 4:\n", i + 1); + printf("Graph #%u of 4:\n", i + 1); nbars = read8u();