aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/ehnt/files/patch-ehnt-lookup
blob: ffcc8fd5c6db5b138d5d0d625d6d56610efacb33 (plain) (blame)
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
--- ehnt_lookup.c.orig  Thu Oct  4 22:18:29 2001
+++ ehnt_lookup.c   Mon May 24 12:01:50 2004
@@ -25,7 +25,7 @@
 
 
 #define ASNCOUNT 65536
-char * ASNs[ASNCOUNT];
+char ** ASNs;
 
 int Init_ASN_Lookups(void) {
 
@@ -34,9 +34,11 @@
   int asn;
   char line[100],asnname[100];
 
-  memset(ASNs,0,sizeof(ASNs));
+  ASNs = calloc(ASNCOUNT, sizeof(char *));
+  if (ASNs == NULL)
+    perror("out of memory");
 
-  if ( ! (f=fopen ("asnc.txt","r")) ) {
+  if ( ! (f=fopen (ASNCDIR "/asnc.txt","r")) ) {
     perror("fopen");
   } else {
     for ( ; ; ) {