Index: /branches/dvo-mods-2007-02/Ohana/src/addstar/src/ReadStarsFITS.c
===================================================================
--- /branches/dvo-mods-2007-02/Ohana/src/addstar/src/ReadStarsFITS.c	(revision 12270)
+++ /branches/dvo-mods-2007-02/Ohana/src/addstar/src/ReadStarsFITS.c	(revision 12271)
@@ -13,15 +13,7 @@
   if (in_theader == NULL) {
     table.header = &theader;
+    if (!gfits_fread_header (f, table.header)) Shutdown ("ERROR: can't read table header");
   } else {
     table.header = in_theader;
-  }
-
-  /* load the table header (skip this?) */
-  if (in_theader == NULL) {
-    if (!gfits_fread_header (f, &theader)) {
-      fprintf (stderr, "ERROR: can't read table header\n");
-      exit (1);
-    }
-  } else {
     Nskip = in_theader[0].size;
     fseek (f, Nskip, SEEK_CUR); 
@@ -34,5 +26,5 @@
   }
 
-  if (!gfits_scan (&theader, "EXTTYPE", "%s", 1, type)) {
+  if (!gfits_scan (table.header, "EXTTYPE", "%s", 1, type)) {
     strcpy (type, "SMPDATA");
   }
