Index: trunk/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 7966)
+++ trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 7973)
@@ -41,4 +41,7 @@
   Nmiss = catalog[0].Nmissing;
   NMISS = Nmiss + 1000;
+  if ((NMISS < 1) || (NMISS > 1e10)) {
+      fprintf (stderr, "weird value for NMISS: %d\n", NMISS);
+  }
   ALLOCATE (next_miss, int, NMISS);
   REALLOCATE (catalog[0].missing, Missing, NMISS);
Index: trunk/Ohana/src/addstar/src/gettycho.c
===================================================================
--- trunk/Ohana/src/addstar/src/gettycho.c	(revision 7966)
+++ trunk/Ohana/src/addstar/src/gettycho.c	(revision 7973)
@@ -63,10 +63,6 @@
       nitems = fread (buffer, NBYTE, NITEM, f);
       if (nitems == 0) break;
-      if (nitems != NITEM) {
-	fprintf (stderr, "ERROR: failure reading data from file %s\n", filename);
-	exit (1);
-      }
 
-      for (j = 0; j < NITEM; j++) {
+      for (j = 0; j < nitems; j++) {
 	line = &buffer[j*NBYTE];
 	stars[Ntycho].R = atof (&line[15]);
@@ -115,4 +111,6 @@
 	CHECK_REALLOCATE (stars, Stars, NTYCHO, Ntycho, 5000);
       }
+
+      if (nitems != NITEM) break;
     }
   next_section:
