]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - pkgs/net-tools/patches/net-tools-1.60-trunc.patch
80760891e0c02ee7daa91f5675692776363df05f
[people/stevee/ipfire-3.x.git] / pkgs / net-tools / patches / net-tools-1.60-trunc.patch
1 --- net-tools-1.60/netstat.c.trunc 2004-08-31 12:42:08.595426960 +0200
2 +++ net-tools-1.60/netstat.c 2004-08-31 12:59:55.766192344 +0200
3 @@ -773,8 +773,8 @@
4 get_sname(htons(local_port), "tcp",
5 flag_not & FLAG_NUM_PORT));
6
7 - if ((strlen(local_addr) + strlen(buffer)) > 22)
8 - local_addr[22 - strlen(buffer)] = '\0';
9 + if ((strlen(local_addr) + strlen(buffer)) >= 27)
10 + local_addr[27 - strlen(buffer) - 1] = '\0';
11
12 strcat(local_addr, ":");
13 strncat(local_addr, buffer, sizeof(local_addr)-strlen(local_addr)-1);
14 @@ -782,8 +782,8 @@
15 snprintf(buffer, sizeof(buffer), "%s",
16 get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
17
18 - if ((strlen(rem_addr) + strlen(buffer)) > 22)
19 - rem_addr[22 - strlen(buffer)] = '\0';
20 + if ((strlen(rem_addr) + strlen(buffer)) >= 27)
21 + rem_addr[27 - strlen(buffer) - 1] = '\0';
22
23 strcat(rem_addr, ":");
24 strncat(rem_addr, buffer, sizeof(rem_addr)-strlen(rem_addr)-1);
25 @@ -816,7 +816,7 @@
26 timer_run, (double) time_len / HZ, retr, timeout);
27 break;
28 }
29 - printf("tcp %6ld %6ld %-23s %-23s %-12s",
30 + printf("tcp %6ld %6ld %-27s %-27s %-12s",
31 rxq, txq, local_addr, rem_addr, _(tcp_state[state]));
32
33 finish_this_one(uid,inode,timers);
34 @@ -1770,7 +1770,7 @@
35 else
36 printf(_("(w/o servers)"));
37 }
38 - printf(_("\nProto Recv-Q Send-Q Local Address Foreign Address State ")); /* xxx */
39 + printf(_("\nProto Recv-Q Send-Q Local Address Foreign Address State ")); /* xxx */
40 if (flag_exp > 1)
41 printf(_(" User Inode "));
42 print_progname_banner();