summaryrefslogtreecommitdiff
path: root/package/iptraf/patches/patch-src_landesc_c
blob: 3af440685a49a6aa22eac45b224453e5aa5460f7 (plain)
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
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- iptraf-3.0.0.orig/src/landesc.c	2005-09-13 08:42:54.000000000 +0200
+++ iptraf-3.0.0/src/landesc.c	2009-05-21 23:01:53.000000000 +0200
@@ -79,12 +79,10 @@ void loaddesclist(struct desclist *list,
     char etherline[140];
     int i, j;                   /* counters used when parsing /etc/ethers */
 
-    bzero(list, sizeof(struct desclist));
+    memset(list, 0, sizeof(struct desclist));
 
     if (linktype == LINK_ETHERNET)
         fd = fopen(ETHFILE, "r");
-    else if (linktype == LINK_FDDI)
-        fd = fopen(FDDIFILE, "r");
 
     if (fd == NULL) {
         return;
@@ -95,8 +93,8 @@ void loaddesclist(struct desclist *list,
             printnomem();
             return;
         }
-        bzero(ptmp, sizeof(struct desclistent));
-        bzero(descline, 140);
+        memset(ptmp, 0, sizeof(struct desclistent));
+        memset(descline, 0, 140);
         fgets(descline, 140, fd);
 
         if (strcmp(descline, "") == 0) {
@@ -145,9 +143,9 @@ void loaddesclist(struct desclist *list,
             printnomem();
             return;
         }
-        bzero(ptmp, sizeof(struct desclistent));
-        bzero(descline, 140);
-        bzero(etherline, 140);
+        memset(ptmp, 0, sizeof(struct desclistent));
+        memset(descline, 0, 140);
+        memset(etherline, 0, 140);
         fgets(etherline, 140, fd);
 
         /* 
@@ -205,8 +203,6 @@ void savedesclist(struct desclist *list,
 
     if (linktype == LINK_ETHERNET)
         fd = fopen(ETHFILE, "w");
-    else if (linktype == LINK_FDDI)
-        fd = fopen(FDDIFILE, "w");
 
     if (fd < 0) {
         etherr();