Index: trunk/Ohana/src/opihi/cmd.data/wd.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/wd.c	(revision 20652)
+++ trunk/Ohana/src/opihi/cmd.data/wd.c	(revision 27435)
@@ -75,9 +75,9 @@
   /* save the (float) version, write out a temporary buffer */
   temp_matrix = buf[0].matrix;
-  ALLOCATE (temp_matrix.buffer, char, MAX(1, temp_matrix.size));
-  memcpy (temp_matrix.buffer, buf[0].matrix.buffer, temp_matrix.size);
+  ALLOCATE (temp_matrix.buffer, char, MAX(1, temp_matrix.datasize));
+  memcpy (temp_matrix.buffer, buf[0].matrix.buffer, temp_matrix.datasize);
   temp_header = buf[0].header;
-  ALLOCATE (temp_header.buffer, char, MAX(1, temp_header.size));
-  memcpy (temp_header.buffer, buf[0].header.buffer, temp_header.size);
+  ALLOCATE (temp_header.buffer, char, MAX(1, temp_header.datasize));
+  memcpy (temp_header.buffer, buf[0].header.buffer, temp_header.datasize);
 
   if (temp_header.Naxes) {
@@ -88,5 +88,5 @@
     gfits_modify (&temp_header, "BSCALE", "%lf", 1, outScale);
     gfits_modify (&temp_header, "BZERO",  "%lf", 1, outZero);
-    gfits_modify (&temp_header, "UNSIGN", "%t", 1, outUnsign);
+    gfits_modify_alt (&temp_header, "UNSIGN", "%t", 1, outUnsign);
   }
 
@@ -94,4 +94,5 @@
     Header Xhead;
     FILE *f;
+    off_t nbytes;
     int status, Nextend;
 
@@ -109,5 +110,5 @@
     }
 
-    gfits_modify (&Xhead, "EXTEND", "%t", 1, TRUE);
+    gfits_modify_alt (&Xhead, "EXTEND", "%t", 1, TRUE);
 
     Nextend = 0;
@@ -125,7 +126,7 @@
     
     /* position to begining of file to write header */
-    fseek (f, 0, SEEK_SET);
-    status = fwrite (Xhead.buffer, 1, Xhead.size, f);
-    if (status != Xhead.size) {
+    fseeko (f, 0LL, SEEK_SET);
+    nbytes = fwrite (Xhead.buffer, 1, Xhead.datasize, f);
+    if (nbytes != Xhead.datasize) {
       gprint (GP_ERR, "ERROR: failed writing data to image header\n");
       status = FALSE;
@@ -144,8 +145,8 @@
 
     /* position to end of file to write new extend */
-    fseek (f, 0, SEEK_END);
-    status = fwrite (temp_header.buffer, 1, temp_header.size, f);
+    fseeko (f, 0LL, SEEK_END);
+    nbytes = fwrite (temp_header.buffer, 1, temp_header.datasize, f);
     fclose (f);
-    if (status != temp_header.size) {
+    if (nbytes != temp_header.datasize) {
       gprint (GP_ERR, "failed to write file\n");
       status = FALSE;
