Index: trunk/pstamp/src/ppstampMakeStamp.c
===================================================================
--- trunk/pstamp/src/ppstampMakeStamp.c	(revision 17047)
+++ trunk/pstamp/src/ppstampMakeStamp.c	(revision 17052)
@@ -2,4 +2,5 @@
 #include <config.h>
 #endif
+#include <strings.h>
 
 #include "ppstamp.h"
@@ -122,5 +123,5 @@
         lastY = image->row0 + image->numRows;
     }
-        
+
     int leftBlank = 0;
     int dstX  = 0;
@@ -173,5 +174,5 @@
 // Build the postage stamp output file
 
-static bool makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input, 
+static bool makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input,
                 pmChip *inChip, pmFPAview *view)
 {
@@ -194,5 +195,5 @@
 
     //   psMetadataPrint(stderr, inChip->concepts, 0);
-    
+
     // These default to zero. would that be ok?
     psMetadataAddS32(target->concepts, PS_LIST_TAIL, "CELL.XBIN", PS_META_REPLACE, "Binning in x", 1);
@@ -236,5 +237,5 @@
         if (ppstampMegacamWorkaround) {
             // the coordinates of the mosaic are shifted 32 pixels from the chip
-            // TODO does this always apply? For example I doubt that applies to 
+            // TODO does this always apply? For example I doubt that applies to
             // skycells.
             extractRegion.x0 -= 32;
@@ -345,5 +346,5 @@
     options->roi.y0 = INFINITY;
     options->roi.y1 = -INFINITY;
-    
+
     pt->sky->rErr = 0;
     pt->sky->dErr = 0;
@@ -422,10 +423,10 @@
 
         if (regionContainsPoint(chipBounds, center->chip)) {
-            psLogMsg("ppstampMakeStamp", 2, "Found center (%f %f) on chip: %s\n", 
+            psLogMsg("ppstampMakeStamp", 2, "Found center (%f %f) on chip: %s\n",
                 center->chip->x, center->chip->y, chipName);
             onChip = true;
         }
     } else {
-        // center specified in pixels. 
+        // center specified in pixels.
         // If the user specified a name of a chip name wait until we get to that one.
         // If no chip name was specified, select this one (the first one that had data)
@@ -499,5 +500,5 @@
     pmChip *chip;
     while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) {
-	bool allDone = false;
+        bool allDone = false;
 
         if (!chip->process || !chip->file_exists) {
@@ -518,5 +519,5 @@
             break;
         case PPSTAMP_ON:
-	case PPSTAMP_PARTIALLY_ON:
+        case PPSTAMP_PARTIALLY_ON:
             returnval = makeStamp(config, options, input, chip, view);
             allDone = true;
@@ -532,5 +533,5 @@
         }
 
-	pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
+        pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
 
         if (allDone) {
@@ -538,5 +539,5 @@
             break;
         }
-    } 
+    }
     pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
 
Index: trunk/pstamp/src/pstampparse.c
===================================================================
--- trunk/pstamp/src/pstampparse.c	(revision 17047)
+++ trunk/pstamp/src/pstampparse.c	(revision 17052)
@@ -5,4 +5,5 @@
 #include <psmodules.h>
 #include <string.h>
+#include <strings.h>
 #include "pstamp.h"
 #include "pstampROI.h"
@@ -135,5 +136,5 @@
         psError(PS_ERR_IO, false, "psFitsReadTable failed for %s", options->fileName);
         return false;
-    } 
+    }
 
     options->md = array->data[0];
@@ -213,5 +214,5 @@
     //         target                               key1
     //
-    // 
+    //
     // we return an array containing strins for the values
 
@@ -283,5 +284,5 @@
     }
     psU64 len = psArrayLength(array);
-    
+
     psString id = NULL;
     if (len > 0) {
@@ -322,5 +323,5 @@
         return NULL;
 
-    psArray *chip_files = runQuery(options, 
+    psArray *chip_files = runQuery(options,
                         "SELECT %s from chipProcessedImfile WHERE chip_id = %s AND class_id = '%s'",
                         "uri", chip_id, class_id, true, NULL);
@@ -343,5 +344,5 @@
     psString warp_id = warpIDForCam(options, cam_id);
 
-    psArray *warp_files = runQuery(options, 
+    psArray *warp_files = runQuery(options,
                         "SELECT %s from warpSkyfile WHERE warp_id = %s"
                         " AND uri IS NOT NULL and (fault = 0 or fault is NULL)",
@@ -384,5 +385,5 @@
 
     psU64 len = psArrayLength(stackIDs);
-    
+
     // loop over the stack's for this exposure and add the images
     for (int i = 0; i < len ; i++ ) {
@@ -424,5 +425,5 @@
 
     psU64 len = psArrayLength(diffIDs);
-    
+
     for (int i = 0; i < len ; i++ ) {
         psString diff_id = (psString) diffIDs->data[i];
@@ -474,5 +475,5 @@
             psString uri = (psString) uris->data[i];
             printf("uri: %s\n", uri ? (psString) uri : "NULL uri");
-        } 
+        }
 #endif
 
@@ -484,5 +485,5 @@
 {
     psArray *results;
-    
+
     results = runQuery(options, "SELECT %s from rawExp WHERE exp_name = '%s'",
                         "exp_id", exposure, NULL, false, NULL);
@@ -603,10 +604,10 @@
     psString cmd = NULL;
 
-    psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type %s -uri %s ", 
+    psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type %s -uri %s ",
         options->req_id, job_type, uri);
-    
+
     if (outputBase != NULL) {
         psStringAppend(&cmd, "-outputBase ");
-    
+
         if (options->outputDirectory) {
             psStringAppend(&cmd, "%s/", options->outputDirectory);
@@ -646,5 +647,5 @@
         for (int i = 0; i< numURIs; i++) {
             psString outputBase = NULL;
-            
+
             // append an integer to the user_tag to get a uniqueu outputBase
             psStringAppend(&outputBase, "%s_%d", user_tag, i);
@@ -677,5 +678,5 @@
     psString    img_type = psMetadataLookupStr(NULL, options->md, "IMG_TYPE");
 
-    if (! turnOffResultsFile(options)) { 
+    if (! turnOffResultsFile(options)) {
         fprintf(stderr, "failed to update resultsFile for request %" PRId64 "\n", options->req_id);
         return false;
@@ -700,7 +701,7 @@
 
     psString cmd = NULL;
-    psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type get_image -uri %s -outputBase %s", 
+    psStringAppend(&cmd, "pstamptool -addjob -req_id %ld -job_type get_image -uri %s -outputBase %s",
         options->req_id, fileName, options->outputDirectory);
-    
+
     int rstatus = system(cmd);
     if (rstatus) {
@@ -792,5 +793,5 @@
             // TODO: the ppstamp argument needs to change to class_id
             // perhaps allow chip as a synonym
-            psStringAppend(&commandArgs, " -chip %s", class_id); 
+            psStringAppend(&commandArgs, " -chip %s", class_id);
         }
         psString user_tag = psMetadataLookupStr(&status, options->md, "USER_TAG");
@@ -839,5 +840,5 @@
 
     // XXX: create a set of status codes to return so the
-    // scripts can distinguish between different errors. 
+    // scripts can distinguish between different errors.
     // For example:
     //      If we can't connect to the DB it's a configuration problem.
