Index: /branches/eam_branches/ohana.20150429/src/addstar/include/addstar.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/include/addstar.h	(revision 38380)
+++ /branches/eam_branches/ohana.20150429/src/addstar/include/addstar.h	(revision 38381)
@@ -327,5 +327,4 @@
 void *memrchr(const void *s, int c, size_t n);
 int addstar_create_ID ();
-int strextend (char *input, char *format,...);
 
 void initMosaicCoords ();
Index: /branches/eam_branches/ohana.20150429/src/addstar/src/args.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/src/args.c	(revision 38380)
+++ /branches/eam_branches/ohana.20150429/src/addstar/src/args.c	(revision 38381)
@@ -480,17 +480,4 @@
 }
 
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
-
 /** addstar modes:
  
Index: /branches/eam_branches/ohana.20150429/src/addstar/src/args_parallel_client.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/src/args_parallel_client.c	(revision 38380)
+++ /branches/eam_branches/ohana.20150429/src/addstar/src/args_parallel_client.c	(revision 38381)
@@ -125,15 +125,2 @@
 }
 
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
-
Index: /branches/eam_branches/ohana.20150429/src/addstar/src/loadICRF_save_remote.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/src/loadICRF_save_remote.c	(revision 38380)
+++ /branches/eam_branches/ohana.20150429/src/addstar/src/loadICRF_save_remote.c	(revision 38381)
@@ -2,17 +2,4 @@
 # include "loadICRF.h"
 # define DEBUG 1
-
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
 
 int loadICRF_save_remote (ICRF_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) {
@@ -64,12 +51,12 @@
 
     // need to generate the remote command
-    char command[1024];
-    snprintf (command, 1024, "loadICRF_client");
-    strextend (command, "-hostID %d", host->hostID);
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-hostdir %s", host->pathname);
-    strextend (command, "-cpt %s", region->name);
-    strextend (command, "-input %s", filename);
-    strextend (command, "-D ADDSTAR_RADIUS %f", options->radius);
+    char *command = NULL;
+    strextend (&command, "loadICRF_client");
+    strextend (&command, "-hostID %d", host->hostID);
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-hostdir %s", host->pathname);
+    strextend (&command, "-cpt %s", region->name);
+    strextend (&command, "-input %s", filename);
+    strextend (&command, "-D ADDSTAR_RADIUS %f", options->radius);
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ohana.20150429/src/addstar/src/loadstarpar_save_remote.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/src/loadstarpar_save_remote.c	(revision 38380)
+++ /branches/eam_branches/ohana.20150429/src/addstar/src/loadstarpar_save_remote.c	(revision 38381)
@@ -2,17 +2,4 @@
 # include "loadstarpar.h"
 # define DEBUG 1
-
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
 
 int loadstarpar_save_remote (StarPar_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) {
@@ -62,11 +49,11 @@
 
     // need to generate the remote command
-    char command[1024];
-    snprintf (command, 1024, "loadstarpar_client");
-    strextend (command, "-hostID %d", host->hostID);
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-hostdir %s", host->pathname);
-    strextend (command, "-cpt %s", region->name);
-    strextend (command, "-input %s", filename);
+    char *command = NULL;
+    strextend (&command, "loadstarpar_client");
+    strextend (&command, "-hostID %d", host->hostID);
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-hostdir %s", host->pathname);
+    strextend (&command, "-cpt %s", region->name);
+    strextend (&command, "-input %s", filename);
 
     // launch the job on the remote machine (no handshake)
@@ -78,4 +65,5 @@
     }
     host->pid = pid; // save for future reference
+    free (command);
     
     save_remote_host (host);
Index: /branches/eam_branches/ohana.20150429/src/addstar/src/resort_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/src/resort_catalogs.c	(revision 38380)
+++ /branches/eam_branches/ohana.20150429/src/addstar/src/resort_catalogs.c	(revision 38381)
@@ -74,16 +74,16 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "addstar_client -resort");
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-hostID %d", table->hosts[i].hostID);
-    strextend (command, "-hostdir %s", table->hosts[i].pathname);
-    strextend (command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
+    char *command = NULL;
+    strextend (&command, "addstar_client -resort");
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-hostID %d", table->hosts[i].hostID);
+    strextend (&command, "-hostdir %s", table->hosts[i].pathname);
+    strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    if (VERBOSE)                   strextend (command, "%s -v");
-    if (NTHREADS)                  strextend (command, "%s -threads %d", NTHREADS);
-    if (OLD_RESORT)                strextend (command, "%s -old-resort");
-    if (options->nosort == 3)      strextend (command, "%s -force-sort");
-    if (options->existing_regions) strextend (command, "%s -existing-regions");
+    if (VERBOSE)                   strextend (&command, "-v");
+    if (NTHREADS)                  strextend (&command, "-threads %d", NTHREADS);
+    if (OLD_RESORT)                strextend (&command, "-old-resort");
+    if (options->nosort == 3)      strextend (&command, "-force-sort");
+    if (options->existing_regions) strextend (&command, "-existing-regions");
 
     fprintf (stderr, "command: %s\n", command);
