Index: /branches/eam_branches/ohana.20150429/Makefile.Common
===================================================================
--- /branches/eam_branches/ohana.20150429/Makefile.Common	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/Makefile.Common	(revision 38391)
@@ -44,18 +44,18 @@
 	@echo ""
 
-$(TEST)/%.$(ARCH): $(TEST)/%.c
-	echo $@
-	echo $*
-	echo $<
-	echo $^
-	@if [ ! -d $(TEST) ]; then mkdir -p $(TEST); fi
+$(TESTDIR)/%.$(ARCH): $(TESTDIR)/%.c
+	@echo $@
+	@echo $*
+	@echo $<
+	@echo $^
+	@if [ ! -d $(TESTDIR) ]; then mkdir -p $(TESTDIR); fi
 	$(CC) $(TEST_CFLAGS) -o $@ $^ $(TEST_LDFLAGS)
 	@echo "compiled $*"
 	@echo ""
 
-$(TESTBIN)/%: $(TEST)/%.$(ARCH)
+$(TESTBIN)/%: $(TESTDIR)/%.$(ARCH)
 	@if [ ! -d $(TESTBIN) ]; then mkdir -p $(TESTBIN); fi
 	rm -f $(TESTBIN)/$*
-	cp $(TEST)/$*.$(ARCH) $(TESTBIN)/$*
+	cp $(TESTDIR)/$*.$(ARCH) $(TESTBIN)/$*
 	@echo "installed $*"
 	@echo ""
@@ -128,4 +128,8 @@
 	rm -f `find . -name "#*"`
 
+test.clean:
+	for i in $(TESTPROG); do rm -f $(TESTBIN)/$$i; done
+	for i in $(TESTPROG); do rm -f $(TESTDIR)/$$i.$(ARCH); done
+
 dist: clean
 	rm -rf $(BIN)
Index: /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_detections_dvopsps.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_detections_dvopsps.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_detections_dvopsps.c	(revision 38391)
@@ -138,24 +138,23 @@
     }
 
-    char command[1024];
-    snprintf (command, 1024, "dvopsps_client detections -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "dvopsps_client detections -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    char tmpline[1024];
-    snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
-
-    if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",       command);                          strcpy (command, tmpline); }
-    if (SAVE_REMOTE) { snprintf (tmpline, 1024, "%s -save %s", command, table->hosts[i].results); strcpy (command, tmpline); }
+    strextend (&command, "-dbhost %s", DATABASE_HOST);
+    strextend (&command, "-dbuser %s", DATABASE_USER);
+    strextend (&command, "-dbpass %s", DATABASE_PASS);
+    strextend (&command, "-dbname %s", DATABASE_NAME);
+
+    if (VERBOSE)     { strextend (&command, "-v");}
+    if (SAVE_REMOTE) { strextend (&command, "-save %s", table->hosts[i].results);} 
 
     // some filters -- these are the detections we skip
-    if (TIME_START) { snprintf (tmpline, 1024, "%s -time-start %s", command, TIME_START); strcpy (command, tmpline); }
-    if (TIME_END)   { snprintf (tmpline, 1024, "%s -time-end %s",   command, TIME_END);   strcpy (command, tmpline); }
+    if (TIME_START) { strextend (&command, "-time-start %s", TIME_START);} 
+    if (TIME_END)   { strextend (&command, "-time-end %s", TIME_END);} 
     
-    if (PHOTCODE_START > 0)      { snprintf (tmpline, 1024, "%s -photcode-start %d", command, PHOTCODE_START); strcpy (command, tmpline); }
-    if (PHOTCODE_END <= INT_MAX) { snprintf (tmpline, 1024, "%s -photcode-end %d",   command, PHOTCODE_END);   strcpy (command, tmpline); }
+    if (PHOTCODE_START > 0)      { strextend (&command, "-photcode-start %d", PHOTCODE_START);} 
+    if (PHOTCODE_END <= INT_MAX) { strextend (&command, "-photcode-end %d", PHOTCODE_END);} 
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_diffobj_dvopsps.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_diffobj_dvopsps.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_diffobj_dvopsps.c	(revision 38391)
@@ -126,17 +126,16 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "dvopsps_client diffobj -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "dvopsps_client diffobj -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    char tmpline[1024];
-    snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
+    strextend (&command, "-dbhost %s", DATABASE_HOST);
+    strextend (&command, "-dbuser %s", DATABASE_USER);
+    strextend (&command, "-dbpass %s", DATABASE_PASS);
+    strextend (&command, "-dbname %s", DATABASE_NAME);
 
-    if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
+    if (VERBOSE)    { strextend (&command, "-v"); }
+    if (SINGLE_CPT) { strextend (&command, "-cpt %s", SINGLE_CPT); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_objects_dvopsps.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_objects_dvopsps.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_objects_dvopsps.c	(revision 38391)
@@ -126,17 +126,16 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "dvopsps_client objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "dvopsps_client objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    char tmpline[1024];
-    snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
+    strextend (&command, "-dbhost %s", DATABASE_HOST);
+    strextend (&command, "-dbuser %s", DATABASE_USER);
+    strextend (&command, "-dbpass %s", DATABASE_PASS);
+    strextend (&command, "-dbname %s", DATABASE_NAME);
 
-    if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
+    if (VERBOSE)    { strextend (&command, "-v"); }
+    if (SINGLE_CPT) { strextend (&command, "-cpt %s", SINGLE_CPT); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c	(revision 38391)
@@ -122,6 +122,6 @@
 
     // options / arguments that can affect relastro_client -update-objects:
-    char command[DVO_MAX_PATH];
-    snprintf (command, DVO_MAX_PATH, "photdbc_client %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D NMEAS_MIN %d -D NMEAS_MIN_FILTERED %d -D AVE_SIGMA_LIM %f -D SIGMA_MAX %f", 
+    char *command = NULL;
+    strextend (&command, "photdbc_client %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D NMEAS_MIN %d -D NMEAS_MIN_FILTERED %d -D AVE_SIGMA_LIM %f -D SIGMA_MAX %f", 
 	      tmproot, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      REGION.Rmin, REGION.Rmax, REGION.Dmin, REGION.Dmax,
@@ -129,14 +129,13 @@
       );
 
-    char tmpline[DVO_MAX_PATH];
-    if (VERBOSE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -v",                command);                             strcpy (command, tmpline); }
-    if (ExcludeByInstMag)   { snprintf (tmpline, DVO_MAX_PATH, "%s -instmag %f %f",    command, INST_MAG_MIN, INST_MAG_MAX); strcpy (command, tmpline); }
-    if (ExcludeByMinSigma)  { snprintf (tmpline, DVO_MAX_PATH, "%s -min-sigma %f",     command, SIGMA_MIN_KEEP); 	        strcpy (command, tmpline); }
-    if (ExcludeByMaxMinMag) { snprintf (tmpline, DVO_MAX_PATH, "%s -maxminmag %f",     command, MAX_MIN_MAG);    	        strcpy (command, tmpline); }
-    if (PHOTCODE_DROP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-drop %s", command, PHOTCODE_DROP_LIST); 	strcpy (command, tmpline); }
-    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-keep %s", command, PHOTCODE_KEEP_LIST); 	strcpy (command, tmpline); }
-    if (CATCOMPRESS)        { snprintf (tmpline, DVO_MAX_PATH, "%s -set-compress %s",  command, CATCOMPRESS); 	                strcpy (command, tmpline); }
-    if (CATFORMAT)          { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s",    command, CATFORMAT); 	                strcpy (command, tmpline); }
-    if (CATMODE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -set-mode %s",      command, CATMODE);        	        strcpy (command, tmpline); }
+    if (VERBOSE)            { strextend (&command, "-v"); }
+    if (ExcludeByInstMag)   { strextend (&command, "-instmag %f %f", INST_MAG_MIN, INST_MAG_MAX); }
+    if (ExcludeByMinSigma)  { strextend (&command, "-min-sigma %f", SIGMA_MIN_KEEP); }
+    if (ExcludeByMaxMinMag) { strextend (&command, "-maxminmag %f", MAX_MIN_MAG); }
+    if (PHOTCODE_DROP_LIST) { strextend (&command, "-photcode-drop %s", PHOTCODE_DROP_LIST); }
+    if (PHOTCODE_KEEP_LIST) { strextend (&command, "-photcode-keep %s", PHOTCODE_KEEP_LIST); }
+    if (CATCOMPRESS)        { strextend (&command, "-set-compress %s", CATCOMPRESS); }
+    if (CATFORMAT)          { strextend (&command, "-set-format %s", CATFORMAT); }
+    if (CATMODE)            { strextend (&command, "-set-mode %s", CATMODE); }
 
     if (PARALLEL_OUTHOSTS) {
@@ -144,5 +143,5 @@
       free  (table_output->hosts[i].pathname);
       table_output->hosts[i].pathname = tmppath;
-      snprintf (tmpline, DVO_MAX_PATH, "%s -hostdir-output %s", command, table_output->hosts[i].pathname); strcpy (command, tmpline); 
+      strextend (&command, "-hostdir-output %s", table_output->hosts[i].pathname);
     }
 
Index: /branches/eam_branches/ohana.20150429/src/relastro/src/high_speed_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/src/high_speed_catalogs.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/relastro/src/high_speed_catalogs.c	(revision 38391)
@@ -147,6 +147,6 @@
     }
 
-    char command[1024];
-    snprintf (command, 1024, "relastro_client -high-speed %s %s %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "relastro_client -high-speed %s %s %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 
 	      PHOTCODE_A_LIST, PHOTCODE_B_LIST, RADIUS, outputDir, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
@@ -154,41 +154,36 @@
 
     // options / arguments that can affect relastro_client -high-speed
-    char tmpline[1024];
-    if (FIT_MODE == FIT_PM_ONLY)  	 { snprintf (tmpline, 1024, "%s -pm",    command);           	strcpy (command, tmpline); }
-    if (FIT_MODE == FIT_PAR_ONLY) 	 { snprintf (tmpline, 1024, "%s -par",   command);           	strcpy (command, tmpline); }
-    if (FIT_MODE == FIT_PM_AND_PAR)      { snprintf (tmpline, 1024, "%s -pmpar", command);           	strcpy (command, tmpline); }
-
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    	strcpy (command, tmpline); }
-    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command); 		     	strcpy (command, tmpline); }
-    if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command); 		     	strcpy (command, tmpline); }
-    if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);  	strcpy (command, tmpline); }
-    if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);   	strcpy (command, tmpline); }
+    if (FIT_MODE == FIT_PM_ONLY)  	 { strextend (&command, "-pm"); }
+    if (FIT_MODE == FIT_PAR_ONLY) 	 { strextend (&command, "-par"); }
+    if (FIT_MODE == FIT_PM_AND_PAR)      { strextend (&command, "-pmpar"); }
+
+    if (VERBOSE)       { strextend (&command, "-v"); }
+    if (VERBOSE2)      { strextend (&command, "-vv"); }
+    if (RESET)         { strextend (&command, "-reset"); }
+    if (ImagSelect)    { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); }
+    if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); }
     
-    if (USE_BASIC_CHECK) { snprintf (tmpline, 1024, "%s -basic-image-search", command);              	strcpy (command, tmpline); }
-
-    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       	strcpy (command, tmpline); }
-    
-    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
-
-    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
-    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
-    if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                      strcpy (command, tmpline); }
-    if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);      strcpy (command, tmpline); }
-    if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
+    if (USE_BASIC_CHECK)     { strextend (&command, "-basic-image-search"); }
+    if (FlagOutlier)         { strextend (&command, "-clip %d", CLIP_THRESH); }
+    if (USE_FIXED_PIXCOORDS) { strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); }
+    if (PHOTCODE_KEEP_LIST)  { strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); }
+    if (PHOTCODE_SKIP_LIST)  { strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); }
+    if (PhotFlagSelect)      { strextend (&command, "+photflags"); }
+    if (PhotFlagBad)         { strextend (&command, "+photflagbad %d", PhotFlagBad); }
+    if (PhotFlagPoor)        { strextend (&command, "+photflagpoor %d", PhotFlagPoor); }
     // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
 
-    if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
-    if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
-
-    if (WHERE_A[0]) { snprintf (tmpline, 1024, "%s -D WHERE_A \"%s\"", command, WHERE_A);               strcpy (command, tmpline); }
-    if (WHERE_B[0]) { snprintf (tmpline, 1024, "%s -D WHERE_B \"%s\"", command, WHERE_B);               strcpy (command, tmpline); }
+    if (MinBadQF > 0.0)        { strextend (&command, "-min-bad-psfqf %f", MinBadQF); }
+    if (MaxMeanOffset != 10.0) { strextend (&command, "-max-mean-offset  %f", MaxMeanOffset); }
+
+    if (WHERE_A[0]) { strextend (&command, "-D WHERE_A \"%s\"", WHERE_A); }
+    if (WHERE_B[0]) { strextend (&command, "-D WHERE_B \"%s\"", WHERE_B); }
 
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
-      strcpy (command, tmpline); 
     }
 
Index: /branches/eam_branches/ohana.20150429/src/relastro/src/hpm_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/src/hpm_catalogs.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/relastro/src/hpm_catalogs.c	(revision 38391)
@@ -145,6 +145,6 @@
     }
 
-    char command[1024];
-    snprintf (command, 1024, "relastro_client -hpm %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "relastro_client -hpm %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 
 	      RADIUS, outputDir, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
@@ -152,38 +152,33 @@
 
     // options / arguments that can affect relastro_client -high-speed
-    char tmpline[1024];
-    if (FIT_MODE == FIT_PM_ONLY)  	 { snprintf (tmpline, 1024, "%s -pm",    command);           	strcpy (command, tmpline); }
-    if (FIT_MODE == FIT_PAR_ONLY) 	 { snprintf (tmpline, 1024, "%s -par",   command);           	strcpy (command, tmpline); }
-    if (FIT_MODE == FIT_PM_AND_PAR)      { snprintf (tmpline, 1024, "%s -pmpar", command);           	strcpy (command, tmpline); }
-
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    	strcpy (command, tmpline); }
-    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command); 		     	strcpy (command, tmpline); }
-    if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command); 		     	strcpy (command, tmpline); }
-    if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);  	strcpy (command, tmpline); }
-    if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);   	strcpy (command, tmpline); }
+    if (FIT_MODE == FIT_PM_ONLY)  	 { strextend (&command, "-pm"); }
+    if (FIT_MODE == FIT_PAR_ONLY) 	 { strextend (&command, "-par"); }
+    if (FIT_MODE == FIT_PM_AND_PAR)      { strextend (&command, "-pmpar"); }
+
+    if (VERBOSE)       { strextend (&command, "-v"); }
+    if (VERBOSE2)      { strextend (&command, "-vv"); }
+    if (RESET)         { strextend (&command, "-reset"); }
+    if (ImagSelect)    { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); }
+    if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); }
     
-    if (USE_BASIC_CHECK) { snprintf (tmpline, 1024, "%s -basic-image-search", command);              	strcpy (command, tmpline); }
-
-    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       	strcpy (command, tmpline); }
-    
-    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
-
-    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
-    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
-    if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                      strcpy (command, tmpline); }
-    if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);      strcpy (command, tmpline); }
-    if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
+    if (USE_BASIC_CHECK)     { strextend (&command, "-basic-image-search"); }
+    if (FlagOutlier)         { strextend (&command, "-clip %d", CLIP_THRESH); }
+    if (USE_FIXED_PIXCOORDS) { strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); }
+    if (PHOTCODE_KEEP_LIST)  { strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); }
+    if (PHOTCODE_SKIP_LIST)  { strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); }
+    if (PhotFlagSelect)      { strextend (&command, "+photflags"); }
+    if (PhotFlagBad)         { strextend (&command, "+photflagbad %d", PhotFlagBad); }
+    if (PhotFlagPoor)        { strextend (&command, "+photflagpoor %d", PhotFlagPoor); }
     // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
 
-    if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
-    if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
+    if (MinBadQF > 0.0)        { strextend (&command, "-min-bad-psfqf %f", MinBadQF); }
+    if (MaxMeanOffset != 10.0) { strextend (&command, "-max-mean-offset  %f", MaxMeanOffset); }
 
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
-      strcpy (command, tmpline); 
     }
 
Index: /branches/eam_branches/ohana.20150429/src/relastro/src/relastro_objects.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relastro/src/relastro_objects.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/relastro/src/relastro_objects.c	(revision 38391)
@@ -147,42 +147,36 @@
     // SRC_MEAS_TOOFEW
 
-    char command[1024];
-    snprintf (command, 1024, "relastro_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s", 
+    char *command = NULL;
+    strextend (&command, "relastro_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE);
 
-    char tmpline[1024];
-    if (FIT_MODE == FIT_PM_ONLY)  	 { snprintf (tmpline, 1024, "%s -pm",    command);           strcpy (command, tmpline); }
-    if (FIT_MODE == FIT_PAR_ONLY) 	 { snprintf (tmpline, 1024, "%s -par",   command);           strcpy (command, tmpline); }
-    if (FIT_MODE == FIT_PM_AND_PAR)      { snprintf (tmpline, 1024, "%s -pmpar", command);           strcpy (command, tmpline); }
-
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
-    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command); 		     strcpy (command, tmpline); }
-    if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command); 		     strcpy (command, tmpline); }
-    if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command); 		     strcpy (command, tmpline); }
-
-    if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);  strcpy (command, tmpline); }
-    if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);   strcpy (command, tmpline); }
-    
-    if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       strcpy (command, tmpline); }
-    
-    if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
-
-    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
-    if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
-    if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                     	strcpy (command, tmpline); }
-    if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);     	strcpy (command, tmpline); }
-    if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);   	strcpy (command, tmpline); }
+    if (FIT_MODE == FIT_PM_ONLY)  	 { strextend (&command, "-pm"); }
+    if (FIT_MODE == FIT_PAR_ONLY) 	 { strextend (&command, "-par"); }
+    if (FIT_MODE == FIT_PM_AND_PAR)      { strextend (&command, "-pmpar"); }
+
+    if (VERBOSE)       { strextend (&command, "-v"); }
+    if (VERBOSE2)      { strextend (&command, "-vv"); }
+    if (RESET)         { strextend (&command, "-reset"); }
+    if (UPDATE)        { strextend (&command, "-update"); }
+    if (ImagSelect)    { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); }
+    if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); }
+    if (FlagOutlier)   { strextend (&command, "-clip %d", CLIP_THRESH); }
+    if (USE_FIXED_PIXCOORDS) { strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); }
+    if (PHOTCODE_KEEP_LIST)  { strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); }
+    if (PHOTCODE_SKIP_LIST)  { strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); }
+    if (PhotFlagSelect)      { strextend (&command, "+photflags"); }
+    if (PhotFlagBad)         { strextend (&command, "+photflagbad %d", PhotFlagBad); }
+    if (PhotFlagPoor)        { strextend (&command, "+photflagpoor %d", PhotFlagPoor); }
     // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
 
-    if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
-    if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
+    if (MinBadQF > 0.0)        { strextend (&command, "-min-bad-psfqf %f", MinBadQF); }
+    if (MaxMeanOffset != 10.0) { strextend (&command, "-max-mean-offset  %f", MaxMeanOffset); }
 
     if (TimeSelect) { 
       char *tstart = ohana_sec_to_date (TSTART);
       char *tstop  = ohana_sec_to_date (TSTOP);
-      snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop); 
+      strextend (&command, "-time %s %s", tstart, tstop); 
       free (tstart);
       free (tstop);
-      strcpy (command, tmpline); 
     }
 
Index: /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_ckids.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_ckids.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_ckids.c	(revision 38391)
@@ -111,13 +111,12 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "ckids_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "ckids_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    char tmpline[1024];
-    if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",          command);                          strcpy (command, tmpline); }
-    if (SINGLE_CPT)  { snprintf (tmpline, 1024, "%s -cpt %s",     command, SINGLE_CPT);              strcpy (command, tmpline); }
-    if (UPDATE)      { snprintf (tmpline, 1024, "%s -update",     command);                          strcpy (command, tmpline); }
+    if (VERBOSE)     { strextend (&command, "-v"); }
+    if (SINGLE_CPT)  { strextend (&command, "-cpt %s", SINGLE_CPT); }
+    if (UPDATE)      { strextend (&command, "-update"); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fiximids.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fiximids.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fiximids.c	(revision 38391)
@@ -112,6 +112,6 @@
     snprintf (table->hosts[i].results, 1024, "%s/fiximids.results.%s.dat", table->hosts[i].pathname, uniquer);
 
-    char command[1024];
-    snprintf (command, 1024, "fiximids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "fiximids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
@@ -119,9 +119,8 @@
     int saveImstats = VERBOSE_IMSTATS || SUMMARY_IMSTATS;
 
-    char tmpline[1024];
-    if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",          command);                          strcpy (command, tmpline); }
-    if (saveImstats) { snprintf (tmpline, 1024, "%s -imstats %s", command, table->hosts[i].results); strcpy (command, tmpline); }
-    if (SINGLE_CPT)  { snprintf (tmpline, 1024, "%s -cpt %s",     command, SINGLE_CPT);              strcpy (command, tmpline); }
-    if (UPDATE)      { snprintf (tmpline, 1024, "%s -update",     command);                          strcpy (command, tmpline); }
+    if (VERBOSE)     { strextend (&command, "-v"); }
+    if (saveImstats) { strextend (&command, "-imstats %s", table->hosts[i].results); }
+    if (SINGLE_CPT)  { strextend (&command, "-cpt %s", SINGLE_CPT); }
+    if (UPDATE)      { strextend (&command, "-update"); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fixstkids.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fixstkids.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fixstkids.c	(revision 38391)
@@ -127,6 +127,6 @@
     snprintf (table->hosts[i].results, 1024, "%s/fixstkids.results.%s.dat", table->hosts[i].pathname, uniquer);
 
-    char command[1024];
-    snprintf (command, 1024, "fixstkids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "fixstkids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
@@ -134,9 +134,8 @@
     int saveImstats = VERBOSE_IMSTATS || SUMMARY_IMSTATS;
 
-    char tmpline[1024];
-    if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",          command);                          strcpy (command, tmpline); }
-    if (saveImstats) { snprintf (tmpline, 1024, "%s -imstats %s", command, table->hosts[i].results); strcpy (command, tmpline); }
-    if (SINGLE_CPT)  { snprintf (tmpline, 1024, "%s -cpt %s",     command, SINGLE_CPT);              strcpy (command, tmpline); }
-    if (UPDATE)      { snprintf (tmpline, 1024, "%s -update",     command);                          strcpy (command, tmpline); }
+    if (VERBOSE)     { strextend (&command, "-v"); }
+    if (saveImstats) { strextend (&command, "-imstats %s", table->hosts[i].results); }
+    if (SINGLE_CPT)  { strextend (&command, "-cpt %s", SINGLE_CPT); }
+    if (UPDATE)      { strextend (&command, "-update"); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setastrom.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setastrom.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setastrom.c	(revision 38391)
@@ -95,20 +95,18 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "setastrom_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "setastrom_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    char tmpline[1024];
-    if (VERBOSE)       	  { snprintf (tmpline, 1024, "%s -v",                	command); 		    strcpy (command, tmpline); }
-    if (UPDATE)        	  { snprintf (tmpline, 1024, "%s -update",           	command); 		    strcpy (command, tmpline); }
-    if (KH_FILE)      	  { snprintf (tmpline, 1024, "%s -KH %s",           	command, KH_FILE);	    strcpy (command, tmpline); }
-    if (DCR_FILE)      	  { snprintf (tmpline, 1024, "%s -DCR %s",           	command, DCR_FILE);	    strcpy (command, tmpline); }
-    if (CAM_FILE)      	  { snprintf (tmpline, 1024, "%s -CAM %s",           	command, CAM_FILE);	    strcpy (command, tmpline); }
-    if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); }
-
-    if (KH_RESET)      	  { snprintf (tmpline, 1024, "%s -KH-reset",           	command);	            strcpy (command, tmpline); }
-    if (DCR_RESET)     	  { snprintf (tmpline, 1024, "%s -DCR-reset",           command);	            strcpy (command, tmpline); }
-    if (CAM_RESET)     	  { snprintf (tmpline, 1024, "%s -CAM-reset",           command);	            strcpy (command, tmpline); }
+    if (VERBOSE)       	  { strextend (&command, "-v"); }
+    if (UPDATE)        	  { strextend (&command, "-update"); }
+    if (KH_FILE)      	  { strextend (&command, "-KH %s", KH_FILE); }
+    if (DCR_FILE)      	  { strextend (&command, "-DCR %s", DCR_FILE); }
+    if (CAM_FILE)      	  { strextend (&command, "-CAM %s", CAM_FILE); }
+    if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
+    if (KH_RESET)      	  { strextend (&command, "-KH-reset"); }
+    if (DCR_RESET)     	  { strextend (&command, "-DCR-reset"); }
+    if (CAM_RESET)     	  { strextend (&command, "-CAM-reset"); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setgalmodel.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setgalmodel.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setgalmodel.c	(revision 38391)
@@ -91,16 +91,15 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "setgalmodel_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "setgalmodel_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
+    if (VERBOSE)       	  { strextend (&command, "-v"); }
+    if (TESTING)       	  { strextend (&command, "-testing"); }
+    if (UPDATE)        	  { strextend (&command, "-update"); }
+    if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
+
     fprintf (stderr, "command: %s\n", command);
-
-    char tmpline[1024];
-    if (VERBOSE)       	  { snprintf (tmpline, 1024, "%s -v",                	command); 		    strcpy (command, tmpline); }
-    if (TESTING)       	  { snprintf (tmpline, 1024, "%s -testing",           	command); 		    strcpy (command, tmpline); }
-    if (UPDATE)        	  { snprintf (tmpline, 1024, "%s -update",           	command); 		    strcpy (command, tmpline); }
-    if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); }
 
     if (PARALLEL_MANUAL) continue;
Index: /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setphot.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setphot.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setphot.c	(revision 38391)
@@ -110,16 +110,15 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "setphot_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "setphot_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
+    if (VERBOSE)       { strextend (&command, "-v"); }
+    if (RESET)         { strextend (&command, "-reset"); }
+    if (UPDATE)        { strextend (&command, "-update"); }
+    if (UBERCAL)       { strextend (&command, "-ubercal"); }
+
     fprintf (stderr, "command: %s\n", command);
-
-    char tmpline[1024];
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
-    if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command); 		     strcpy (command, tmpline); }
-    if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command); 		     strcpy (command, tmpline); }
-    if (UBERCAL)       { snprintf (tmpline, 1024, "%s -ubercal",        command); 		     strcpy (command, tmpline); }
 
     if (PARALLEL_MANUAL) continue;
Index: /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setposangle.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setposangle.c	(revision 38390)
+++ /branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setposangle.c	(revision 38391)
@@ -112,14 +112,13 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
+    char *command = NULL;
+    strextend (&command, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
+    if (VERBOSE)       { strextend (&command, "-v"); }
+    if (UPDATE)        { strextend (&command, "-update"); }
+
     fprintf (stderr, "command: %s\n", command);
-
-    char tmpline[1024];
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
-    if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command); 		     strcpy (command, tmpline); }
 
     if (PARALLEL_MANUAL) continue;
