Index: trunk/psLib/src/fits/psFits.c
===================================================================
--- trunk/psLib/src/fits/psFits.c	(revision 14872)
+++ trunk/psLib/src/fits/psFits.c	(revision 14876)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-17 23:01:00 $
+ *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-18 02:33:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -594,8 +594,11 @@
     }
 
-    int status = false;
-    fits_set_compression_type(fits->fd, comptype, &status);
-    if (!status) {
-        goto ERROR;
+    int status = 0;
+    if (fits_set_compression_type(fits->fd, comptype, &status)) {
+        char fitsErr[MAX_STRING_LENGTH];
+        fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_BAD_FITS, true,
+            "Error while configuring compression. CFITSIO error: %s", fitsErr);
+        return false;
     }
 
@@ -612,30 +615,42 @@
     }
     // status check belongs to fits_set_tile_dim() call
-    if (!status) {
-        goto ERROR;
-    }
-
-    fits_set_noise_bits(fits->fd, noisebits, &status);
-    if (!status) {
-        goto ERROR;
-    }
+    if (status) {
+        fits_set_compression_type(fits->fd, 0x0, &status);
+        char fitsErr[MAX_STRING_LENGTH];
+        fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_BAD_FITS, true,
+            "Error while configuring compression. CFITSIO error: %s", fitsErr);
+        return false;
+    }
+
+    if (fits_set_noise_bits(fits->fd, noisebits, &status)) {
+        fits_set_compression_type(fits->fd, 0x0, &status);
+        char fitsErr[MAX_STRING_LENGTH];
+        fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_BAD_FITS, true,
+            "Error while configuring compression. CFITSIO error: %s", fitsErr);
+        return false;
+    }
+
 #if FITS_HCOMP
-    fits_set_hcomp_scale(fits->fd, scale, &status);
-    if (!status) {
-        goto ERROR;
-    }
-    fits_set_hcomp_smooth(fits->fd, smooth, &status);
-    if (!status) {
-        goto ERROR;
+    if (fits_set_hcomp_scale(fits->fd, scale, &status)) {
+        fits_set_compression_type(fits->fd, 0x0, &status);
+        char fitsErr[MAX_STRING_LENGTH];
+        fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_BAD_FITS, true,
+            "Error while configuring compression. CFITSIO error: %s", fitsErr);
+        return false;
+    }
+    if (fits_set_hcomp_smooth(fits->fd, smooth, &status)) {
+        fits_set_compression_type(fits->fd, 0x0, &status);
+        char fitsErr[MAX_STRING_LENGTH];
+        fits_get_errstatus(status, fitsErr);
+        psError(PS_ERR_BAD_FITS, true,
+            "Error while configuring compression. CFITSIO error: %s", fitsErr);
+        return false;
     }
 #endif // FITS_HCOMP
 
-ERROR:
-    fits_set_compression_type(fits->fd, 0x0, &status);
-    char fitsErr[MAX_STRING_LENGTH];
-    fits_get_errstatus(status, fitsErr);
-    psError(PS_ERR_BAD_FITS, true,
-        "Error while configuring compression. CFITSIO error: %s", fitsErr);
-    return false;
+    return true;
 }
 
