Permalink
Browse files

Increased the number of pulsars to be read in the catalog and added a…

… check
  • Loading branch information...
1 parent 16a7143 commit 1b1f364ede47a0a9c05c627d763a3b06ef6044ce @gdesvignes gdesvignes committed Oct 7, 2012
Showing with 6 additions and 1 deletion.
  1. +1 −1 include/database.h
  2. +5 −0 src/database.c
View
@@ -1,5 +1,5 @@
/* Number of entries in PSR database */
-#define NP 2000
+#define NP 3000
#define NBP 200
/* This is a structure that contains the "normal" information in the database */
View
@@ -27,6 +27,11 @@ int read_database(void)
database = chkfopen(databasenm, "rb");
while (chkfread(&pdata, sizeof(psrdata), 1, database)) {
+ if (np >= NP) {
+ printf("NP value set to small (%d) in $PRESTO/include/database.h\n", NP);
+ printf("Please increase it and recompile\n");
+ exit(-1);
+ }
strncpy(pulsardata[np].jname, pdata.jname, 13);
strncpy(pulsardata[np].bname, pdata.bname, 9);
strncpy(pulsardata[np].alias, pdata.alias, 10);

0 comments on commit 1b1f364

Please sign in to comment.