1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
Description: Various compiler warnings.
Castings are used to account for bad type choices.
Author: Mats Erik Andersson <debian@gisladisker.se>
Forwarded: yes
Last-Update: 2010-10-21
diff -Naup ipband-0.8.1.debian/init.c ipband-0.8.1/init.c
--- ipband-0.8.1.debian/init.c
+++ ipband-0.8.1/init.c
@@ -402,7 +402,7 @@ void preload_subnets(char *str, hlist_t
/* Apply mask */
netip &= mask_m;
- sprintf(key,"%08x",netip);
+ sprintf((char *) key,"%08x",netip);
/* Set bandwidth threshold for this net */
idata.band = bwidth;
diff -Naup ipband-0.8.1.debian/packets.c ipband-0.8.1/packets.c
--- ipband-0.8.1.debian/packets.c
+++ ipband-0.8.1/packets.c
@@ -58,8 +58,8 @@ void storepkt (struct pcap_pkthdr *pkthd
/* Apply mask and get our key - network number */
ip_src &= mask_m;
ip_dst &= mask_m;
- sprintf(key_src,"%08x",ip_src);
- sprintf(key_dst,"%08x",ip_dst);
+ sprintf((char *) key_src,"%08x",ip_src);
+ sprintf((char *) key_dst,"%08x",ip_dst);
/* Store length of this packet */
idata.nbyte = (double) length;
@@ -299,7 +299,7 @@ void proc_aggr (hlist_t **ha, hlist_t **
}
if (do_html) {
- html_report(" <tr><td nowrap class=\"text\">%s</td><td> </td>", hex2dot(t->key));
+ html_report(" <tr><td nowrap class=\"text\">%s</td><td> </td>", hex2dot((char *) t->key));
html_report("<td align=\"right\" nowrap class=\"text\">%.2f kBps</td></tr>\n",kBps);
}
@@ -309,7 +309,7 @@ void proc_aggr (hlist_t **ha, hlist_t **
fprintf (outfile_m, "*");
else
fprintf (outfile_m, " ");
- fprintf (outfile_m, "%-15s", hex2dot(t->key));
+ fprintf (outfile_m, "%-15s", hex2dot((char *) t->key));
fprintf (outfile_m, " %7.2f kB ",kbytes);
fprintf (outfile_m, " %7.2f/%6.2f kBps",kBps,thresh);
fprintf (outfile_m, "\n");
@@ -371,7 +371,7 @@ void detail_cleanup (hlist_t **ha_d, U_C
ntable = 1 << nhashbit;
/* Get subnet number in int */
- sscanf(key,"%08x",&ip_key);
+ sscanf((char *) key,"%08x",&ip_key);
/* Walk table */
for (hash = 0; hash < ntable; hash++) {
diff -Naup ipband-0.8.1.debian/reports.c ipband-0.8.1/reports.c
--- ipband-0.8.1.debian/reports.c
+++ ipband-0.8.1/reports.c
@@ -52,17 +52,17 @@ void subnet_report (hlist_t **ha_d, U_CH
qsort(conn,nconn,sizeof(hlist_t *),compare_bytes);
/* Get network name if available */
- sscanf(key,"%08x",&ikey);
+ sscanf((char *) key,"%08x",&ikey);
net_s = getnetbyaddr(ikey,AF_INET);
/* Print e-mail subject to include subnet info */
- if(net_s) va_report("Subject: Bandwidth report for %s <%s>\n\n",hex2dot(key),net_s->n_name);
- else va_report("Subject: Bandwidth report for %s\n\n",hex2dot(key));
+ if(net_s) va_report("Subject: Bandwidth report for %s <%s>\n\n",hex2dot((char *) key),net_s->n_name);
+ else va_report("Subject: Bandwidth report for %s\n\n",hex2dot((char *) key));
/* Print header */
va_report("\nDate: %s", ctime(&now));
if(top_m) va_report("Showing top %d connections\n",top_m);
- va_report("Network: %s", hex2dot(key));
+ va_report("Network: %s", hex2dot((char *) key));
if(net_s) va_report(" <%s>",net_s->n_name);
va_report("\n");
va_report("Bandwidth threshold: %.2f kBps, exceeded for: %.2f min\n",thresh,(float) exc_time/60.0);
@@ -104,7 +104,7 @@ void subnet_report (hlist_t **ha_d, U_CH
/* Skiping subnets other than our */
ip_src = data->subnet_src;
ip_dst = data->subnet_dst;
- sscanf(key,"%08x",&ip_key);
+ sscanf((char *) key,"%08x",&ip_key);
if ( !(ip_src == ip_key || ip_dst == ip_key) ) continue;
/* Inreasing loop counter only after other subnets are
@@ -171,7 +171,7 @@ char *get_service(int port, int prot) {
ll_srvc_t *p;
char *srvcs;
- char *prots;
+ char *prots = NULL;
struct servent *srvc_s;
struct protoent *prot_s;
|