Index: trunk/Ohana/src/imregister/detrend/altpath.c
===================================================================
--- trunk/Ohana/src/imregister/detrend/altpath.c	(revision 34088)
+++ trunk/Ohana/src/imregister/detrend/altpath.c	(revision 40501)
@@ -7,5 +7,5 @@
   off_t i, j, n, Nlist;
   off_t *list;
-  char *dBPath, infile[256], outfile[256], line[1024];
+  char *dBPath, infile[512], outfile[512], line[1100];
   struct stat statbuf;
 
@@ -28,6 +28,6 @@
       i = list[j];
       for (n = 0; n < NDetrendAltDB; n++) {
-	sprintf (infile, "%s/%s", dBPath, image[i].filename);
-	sprintf (outfile, "%s/%s", DetrendAltDB[n], image[i].filename);
+	snprintf (infile, 512, "%s/%s", dBPath, image[i].filename);
+	snprintf (outfile, 512, "%s/%s", DetrendAltDB[n], image[i].filename);
 	status = ckpathname (outfile);
 	if (!status) {
@@ -35,5 +35,5 @@
 	  continue;
 	}
-	sprintf (line, "cp %s %s", infile, outfile);
+	snprintf (line, 1100, "cp %s %s", infile, outfile);
 	fprintf (stderr, "%s\n", line);
 	status = system (line);
@@ -73,6 +73,6 @@
       image[i].altpath = FALSE;
       for (n = 0; n < NDetrendAltDB; n++) {
-	sprintf (outfile, "%s/%s", DetrendAltDB[n], image[i].filename);
-	sprintf (line, "rm %s", outfile);
+	snprintf (outfile, 512, "%s/%s", DetrendAltDB[n], image[i].filename);
+	snprintf (line, 1100, "rm %s", outfile);
 	fprintf (stderr, "%s\n", line);
 	status = system (line);
@@ -104,5 +104,5 @@
       found = TRUE;
       for (n = 0; found && (n < NDetrendAltDB); n++) {
-	sprintf (outfile, "%s/%s", DetrendAltDB[n], image[i].filename);
+	snprintf (outfile, 512, "%s/%s", DetrendAltDB[n], image[i].filename);
 	status = stat (outfile, &statbuf);
 	fprintf (stderr, "checking for %s, status is %d\n", outfile, status);
