Index: /trunk/Ohana/Makefile
===================================================================
--- /trunk/Ohana/Makefile	(revision 4851)
+++ /trunk/Ohana/Makefile	(revision 4852)
@@ -44,5 +44,4 @@
 opihi       \
 perl        \
-photdbc     \
 relphot     \
 shell       \
@@ -61,4 +60,5 @@
 lightcurve  \
 markrock    \
+photdbc     \
 markstar    \
 mosastro.v1 \
Index: /trunk/Ohana/src/imregister/src/convertimreg.c
===================================================================
--- /trunk/Ohana/src/imregister/src/convertimreg.c	(revision 4851)
+++ /trunk/Ohana/src/imregister/src/convertimreg.c	(revision 4852)
@@ -1,5 +1,5 @@
 # include "imregister.h"
 # include "imreg.h"
-static char *version = "convertimreg $Revision: 3.2 $";
+static char *version = "convertimreg $Revision: 3.3 $";
 
 int main (int argc, char **argv) {
@@ -50,5 +50,5 @@
   }
   fclearlockfile (argv[1], f, lockstate, &dbstate);
-  fits_convert_RegImage (regimage, sizeof (RegImage), Nregimage);
+  fits_convert_RegImage (pimage, sizeof (RegImage), Nimage);
 
   /* create complete subset */
Index: /trunk/Ohana/src/misc/src/ftable.c
===================================================================
--- /trunk/Ohana/src/misc/src/ftable.c	(revision 4851)
+++ /trunk/Ohana/src/misc/src/ftable.c	(revision 4852)
@@ -202,7 +202,4 @@
   FILE *f;
 
-  /* find extension of interest */
-  if (!Nextend && (Extname == (char *) NULL)) Nextend = 1;
-
   /* open file */
   f = fopen (file, "r");
@@ -230,9 +227,9 @@
 
   /* search for extension of interest */
-  for (i = 1; fits_fread_Theader (f, header); i++) {
-    if (Nextend && (Nextend == i)) return (f);
+  for (i = 0; fits_fread_Theader (f, header); i++) {
+    if ((Extname == NULL) && (Nextend == i)) return (f);
 
     fits_scan (header, "EXTNAME", "%s", 1, extname);
-    if ((Extname != (char *) NULL) && (!strcmp (Extname, extname))) return (f);
+    if ((Extname != NULL) && (!strcmp (Extname, extname))) return (f);
 
     Nbytes = fits_matrix_size (header);
@@ -357,7 +354,7 @@
     fits_scan (header, field, "%s", 1, unit);
     sprintf (field, "TNULL%d", i);
-    fits_scan (header, field, "%s", 1, null);
+    if (!fits_scan (header, field, "%s", 1, null)) strcpy (null, "none");
     sprintf (field, "TNVAL%d", i);
-    fits_scan (header, field, "%s", 1, nval);
+    if (!fits_scan (header, field, "%s", 1, nval)) strcpy (nval, "none");
 
     fprintf (stdout, "%-18s %-32s %-18s %-6s %-8s %-8s\n", 
Index: /trunk/Ohana/src/opihi/dvo/cmatch.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/cmatch.c	(revision 4851)
+++ /trunk/Ohana/src/opihi/dvo/cmatch.c	(revision 4852)
@@ -3,10 +3,7 @@
 int cmatch (int argc, char **argv) {
   
-  FILE *f;
   Catalog catalog1, catalog2;
-  int i, Nbytes, nbytes, Nitems, nitems;
-  char *tbuffer, filename[128];
-  int nstar, NSTARS;
-  double R, D, M, radius;
+  char filename[128];
+  double radius;
   char catdir[256], gscdir[256];
   Vector *rvec, *dvec, *mvec, *drvec, *ddvec, *dmvec;
@@ -14,6 +11,6 @@
   VarConfig ("GSCDIR", "%s", gscdir);
   VarConfig ("CATDIR", "%s", catdir);
-  if (VarConfig ("CATMODE", "%s", catalog.catmode) == NULL) 
-    strcpy (catalog.catmode, "RAW");
+  if (VarConfig ("CATMODE", "%s", catalog1.catmode) == NULL) 
+    strcpy (catalog1.catmode, "RAW");
       
   if (argc != 9) {
@@ -39,17 +36,19 @@
   sprintf (filename, "%s/%s", catdir, argv[1]);
   catalog1.filename = filename;
-  switch (lock_catalog (&catalog, LCK_SOFT)) {
+  switch (lock_catalog (&catalog1, LCK_SOFT)) {
   case 2:
-    unlock_catalog (&catalog);
+    unlock_catalog (&catalog1);
   case 0:
     return (FALSE);
   }
-  if (!load_catalog (&catalog, LOAD_AVES | LOAD_MEAS | LOAD_SECF, TRUE)) {
-    unlock_catalog (&catalog);
+  if (!load_catalog (&catalog1, LOAD_AVES | LOAD_MEAS | LOAD_SECF, TRUE)) {
+    unlock_catalog (&catalog1);
     return (FALSE);
   }
-  unlock_catalog (&catalog);
+  unlock_catalog (&catalog1);
   fprintf (stderr, "read %d stars from phot catalog file %s\n", catalog1.Naverage, filename);
 
+  /* this is for loading from a text file, presumably hstgsc or usno
+     replace this with references to the ra and dec vectors?
   nstar = 0;
   NSTARS = DNSTARS;
@@ -76,4 +75,5 @@
   catalog2.Naverage = nstar;
   fclose (f);
+  */
 
   /* sort data in order of RA */
