A patch to use a larger database of satellites with
predict (http://www.qsl.net/kd2bd/predict.html).

diff -pru predict-2.3.1/predict.c predict-2.3.1-larger-db/predict.c
--- predict-2.3.1/predict.c	2023-08-05 17:33:14.000000000 +0200
+++ predict-2.3.1-larger-db/predict.c	2023-08-26 17:55:34.505674812 +0200
@@ -129,6 +129,8 @@
 #define VISIBLE_FLAG           0x002000
 #define SAT_ECLIPSED_FLAG      0x004000
 
+#define NUMBER_OF_SATELLITES	512
+
 struct	{  char line1[70];
 	   char line2[70];
 	   char name[25];
@@ -147,7 +149,7 @@ struct	{  char line1[70];
 	   double nddot6;
   	   double bstar;
 	   unsigned orbitnum;
-	}  sat[24];
+	}  sat[NUMBER_OF_SATELLITES];
 
 struct	{  char callsign[17];
 	   double stnlat;
@@ -169,7 +171,7 @@ struct	{  char name[25];
 	   unsigned char dayofweek[10];
 	   int phase_start[10];
 	   int phase_end[10];
-	}  sat_db[24];
+	}  sat_db[NUMBER_OF_SATELLITES];
 
 /* Global variables for sharing data among functions... */
 
@@ -206,17 +208,19 @@ unsigned char val[256], buffer[65536];
 /* The following variables are used by the socket server.  They
    are updated in the MultiTrack() and SingleTrack() functions. */
 
-char	visibility_array[24], tracking_mode[30];
+char	visibility_array[NUMBER_OF_SATELLITES], tracking_mode[30];
 
-float	az_array[24], el_array[24], long_array[24], lat_array[24],
-	footprint_array[24], range_array[24], altitude_array[24],
-	velocity_array[24], eclipse_depth_array[24], phase_array[24],
-	squint_array[24];
+float	az_array[NUMBER_OF_SATELLITES], el_array[NUMBER_OF_SATELLITES],
+	long_array[NUMBER_OF_SATELLITES], lat_array[NUMBER_OF_SATELLITES],
+	footprint_array[NUMBER_OF_SATELLITES], range_array[NUMBER_OF_SATELLITES],
+	altitude_array[NUMBER_OF_SATELLITES], velocity_array[NUMBER_OF_SATELLITES],
+	eclipse_depth_array[NUMBER_OF_SATELLITES], phase_array[NUMBER_OF_SATELLITES],
+	squint_array[NUMBER_OF_SATELLITES];
 
-double	doppler[24], nextevent[24];
+double	doppler[NUMBER_OF_SATELLITES], nextevent[NUMBER_OF_SATELLITES];
 
-long	aos_array[24];
-unsigned orbitnum_array[24];
+long	aos_array[NUMBER_OF_SATELLITES];
+unsigned orbitnum_array[NUMBER_OF_SATELLITES];
 
 unsigned short portbase=0;
 
@@ -2458,7 +2462,7 @@ void socket_server (char *predict_name)
 
 			/* Do a simple search for the matching satellite name */
 
-			for (i=0; i<24; i++)
+			for (i=0; i<NUMBER_OF_SATELLITES; i++)
 			{
 				if ((strncmp(satname,sat[i].name,25)==0) || (atol(satname)==sat[i].catnum))
 				{
@@ -2487,7 +2491,7 @@ void socket_server (char *predict_name)
 
 			/* Do a simple search for the matching satellite name */
 
-			for (i=0; i<24; i++)
+			for (i=0; i<NUMBER_OF_SATELLITES; i++)
 			{
 				if ((strncmp(satname,sat[i].name,25)==0) || (atol(satname)==sat[i].catnum))
 				{
@@ -2514,7 +2518,7 @@ void socket_server (char *predict_name)
 
 			/* Do a simple search for the matching satellite name */
 
-			for (i=0; i<24; i++)
+			for (i=0; i<NUMBER_OF_SATELLITES; i++)
 			{
 				if ((strncmp(satname,sat[i].name,25)==0) || (atol(satname)==sat[i].catnum))
 				{
@@ -2535,7 +2539,7 @@ void socket_server (char *predict_name)
 		{
 			buff[0]=0;
 
-			for (i=0; i<24; i++)
+			for (i=0; i<NUMBER_OF_SATELLITES; i++)
 			{
 				if (sat[i].name[0]!=0)
 					strcat(buff,sat[i].name);
@@ -3116,7 +3120,7 @@ char ReadDataFiles (void)
 
 	if (fd!=NULL)
 	{
-		while (x<24 && feof(fd)==0)
+		while (x<NUMBER_OF_SATELLITES && feof(fd)==0)
 		{
 			/* Initialize variables */
 
@@ -3185,7 +3189,7 @@ char ReadDataFiles (void)
 
 				/* Search for match */
 
-				for (y=0, match=0; y<24 && match==0; y++)
+				for (y=0, match=0; y<NUMBER_OF_SATELLITES && match==0; y++)
 				{
 					if (catnum==sat[y].catnum)
 					{
@@ -3371,7 +3375,7 @@ void SaveTLE (void)
 
 	fd=fopen(tlefile,"w");
 
-	for (x=0; x<24; x++)
+	for (x=0; x<NUMBER_OF_SATELLITES; x++)
 	{
 		/* Convert numeric orbital data to ASCII TLE format */
 
@@ -3396,7 +3400,7 @@ void SaveDB (void)
 
 	fd=fopen(dbfile,"w");
 
-	for (x=0; x<24; x++)
+	for (x=0; x<NUMBER_OF_SATELLITES; x++)
 	{
 		if (sat_db[x].name[0]==0)
 			fprintf(fd,"%s\n",sat[x].name);
@@ -3645,7 +3649,7 @@ int AutoUpdate (char *string)
 	   set if this function is invoked via the command line. */
 
 	char line1[80], line2[80], str0[80], str1[80], str2[80],
-	     filename[70], interactive=0, savecount=0, updated[24]={0};
+	     filename[70], interactive=0, savecount=0, updated[NUMBER_OF_SATELLITES]={0};
 
 	float database_epoch=0.0, tle_epoch=0.0, database_year, tle_year;
 	int i, success=0, kepcount=0, updatecount=0;
@@ -3723,9 +3727,9 @@ int AutoUpdate (char *string)
 					/* Scan for object number in datafile to see
 					   if this is something we're interested in */
 
-					for (i=0; (i<24 && sat[i].catnum!=atol(SubString(line1,2,6))); i++);
+					for (i=0; (i<NUMBER_OF_SATELLITES && sat[i].catnum!=atol(SubString(line1,2,6))); i++);
 
-					if (i!=24)
+					if (i!=NUMBER_OF_SATELLITES)
 					{
 						/* We found it!  Check to see if it's more
 						   recent than the data we already have. */
@@ -3785,7 +3789,7 @@ int AutoUpdate (char *string)
 				mvprintw(3,35,"Updated:\n\n\n\n\n");
 				attrset(COLOR_PAIR(3)|A_BOLD);
 
-				for (i=0; i<24; i++)
+				for (i=0; i<NUMBER_OF_SATELLITES; i++)
 				{
 					if (updated[i])
 					{
@@ -3808,10 +3812,10 @@ int AutoUpdate (char *string)
 					mvprintw(19,21,"  Only 1 satellite was updated.");
 				else
 				{
-					if (updatecount==24)
-						mvprintw(19,21,"  All 24 satellites were updated!");
+					if (updatecount==NUMBER_OF_SATELLITES)
+						mvprintw(19,21,"  All %u satellites were updated!",NUMBER_OF_SATELLITES);
 					else
-						mvprintw(19,21,"%u out of 24 satellites were updated.",updatecount);
+						mvprintw(19,21,"%u out of %u satellites were updated.",updatecount,NUMBER_OF_SATELLITES);
 				}
 				
 				refresh();
@@ -5234,7 +5238,7 @@ void ShowOrbitData (void)
 
 	x=Select();
 
-	while (x>=0 && x<24)
+	while (x>=0 && x<NUMBER_OF_SATELLITES)
 	{
 		if (sat[x].meanmo!=0.0)
 		{
@@ -6243,10 +6247,11 @@ int MultiTrack (void)
 	   for the Sun and Moon are also displayed. */
 
 	int		x, y, z, ans, ret=0;
-	unsigned char	satindex[24], inrange[24], sunstat=0, ok2predict[24];
+	unsigned char	satindex[NUMBER_OF_SATELLITES], inrange[NUMBER_OF_SATELLITES],
+			sunstat=0, ok2predict[NUMBER_OF_SATELLITES];
 	char		alstr[3][80];
-	double		aos[24], aos2[24], temptime,
-			nextcalctime=0.0, los[24], aoslos[24];
+	double		aos[NUMBER_OF_SATELLITES], aos2[NUMBER_OF_SATELLITES], temptime,
+			nextcalctime=0.0, los[NUMBER_OF_SATELLITES], aoslos[NUMBER_OF_SATELLITES];
 
 	if (xterm)
 		fprintf(stderr,"\033]0;PREDICT: Multi-Satellite Tracking Mode\007");
@@ -6272,7 +6277,7 @@ int MultiTrack (void)
 
 	mvprintw(4,0," Satellite  Az   El %s  %s  Range  | Satellite  Az   El %s  %s  Range   ",(io_lat=='N'?"LatN":"LatS"),(io_lon=='W'?"LonW":"LonE"),(io_lat=='N'?"LatN":"LatS"),(io_lon=='W'?"LonW":"LonE"));
 
-	for (x=0; x<24; x++)
+	for (x=0; x<NUMBER_OF_SATELLITES; x++)
 	{
 		if (Geostationary(x)==0 && AosHappens(x)==1 && Decayed(x,0.0)!=1)
 			ok2predict[x]=1;
@@ -6289,7 +6294,7 @@ int MultiTrack (void)
 
 	do
 	{
-		for (z=0; z<24; z++)
+		for (z=0; z<NUMBER_OF_SATELLITES; z++)
 		{
 			y=z/2;
 
@@ -6449,7 +6454,7 @@ int MultiTrack (void)
 		{
 			/* Bubble sort the AOS times */
 
-			for (z=22; z>=0; z--)
+			for (z=NUMBER_OF_SATELLITES-2; z>=0; z--)
 				for (y=0; y<=z; y++)
 					if (aos2[y]>=aos2[y+1])
 					{
@@ -6464,8 +6469,8 @@ int MultiTrack (void)
 
 			/* Generate a list of upcoming passes */
 
-			/* for (x=0, y=0, z=-1; x<21 && y!=3; x++) */
-			for (x=0, y=0, z=-1; x<23 && y!=3; x++)
+			/* for (x=0, y=0, z=-1; x<NUMBER_OF_SATELLITES-3 && y!=3; x++) */
+			for (x=0, y=0, z=-1; x<NUMBER_OF_SATELLITES-1 && y!=3; x++)
 			{
 				if (ok2predict[satindex[x]] && aos2[x]!=0.0)
 				{
@@ -7525,7 +7530,7 @@ int QuickFind (char *string, char *outpu
  
 	/* Do a simple search for the matching satellite name */
 
-	for (z=0; z<24; z++)
+	for (z=0; z<NUMBER_OF_SATELLITES; z++)
 	{
 		if ((strcmp(sat[z].name,satname)==0) || (atol(satname)==sat[z].catnum))
 		{
@@ -7650,7 +7655,7 @@ int QuickPredict (char *string, char *ou
 
 	/* Do a simple search for the matching satellite name */
 
-	for (z=0; z<24; z++)
+	for (z=0; z<NUMBER_OF_SATELLITES; z++)
 	{
 		if ((strcmp(sat[z].name,satname)==0) || (atol(satname)==sat[z].catnum))
 		{
@@ -7743,7 +7748,7 @@ int QuickDoppler100 (char *string, char
 
 	/* Do a simple search for the matching satellite name */
 
-	for (z=0; z<24; z++)
+	for (z=0; z<NUMBER_OF_SATELLITES; z++)
 	{
 		if ((strcmp(sat[z].name,satname)==0) || (atol(satname)==sat[z].catnum))
 		{
