Index: trunk/pstamp/src/pstampparse.c
===================================================================
--- trunk/pstamp/src/pstampparse.c	(revision 16978)
+++ 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.
