summaryrefslogtreecommitdiff
path: root/net-mgmt/ehnt/files/patch-ehnt-lookup
blob: 3e43b700e73ded6ec1ea4d9766c792b4b2b90d1f (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
26
27
28
$FreeBSD$

--- 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 ( ; ; ) {