Index: trunk/psModules/src/objects/pmSourceIO_OBJ.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO_OBJ.c	(revision 15562)
+++ trunk/psModules/src/objects/pmSourceIO_OBJ.c	(revision 18840)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-11-10 01:09:20 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-08-01 00:46:04 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -64,5 +64,5 @@
         pmSource *source = (pmSource *) sources->data[i];
 
-	// no difference between PSF and non-PSF model
+        // no difference between PSF and non-PSF model
         pmModel *model = pmSourceGetModel (NULL, source);
         if (model == NULL)
@@ -95,5 +95,10 @@
         psLineAdd (line, "%8.3f", source->apMag);
         psLineAdd (line, "%8.2f\n", apResid);
-        fwrite (line->line, 1, line->Nline, f);
+        if (fwrite (line->line, 1, line->Nline, f) < line->Nline) {
+            psError(PS_ERR_IO, true, "Unable to write OBJ sources file (%s)", filename);
+            close(f);
+            psFree(line);
+            return false;
+        }
     }
     fclose (f);
