IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2008, 2:46:04 PM (18 years ago)
Author:
Paul Price
Message:

Check return value of fwrite (to get around a compiler warning
"ignoring return value of 'fwrite', declared with attribute
warn_unused_result"). Not sure I'm checking it against the right
value, but I figure we rarely, if ever, use this function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO_OBJ.c

    r15562 r18840  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-11-10 01:09:20 $
     5 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-08-01 00:46:04 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6464        pmSource *source = (pmSource *) sources->data[i];
    6565
    66         // no difference between PSF and non-PSF model
     66        // no difference between PSF and non-PSF model
    6767        pmModel *model = pmSourceGetModel (NULL, source);
    6868        if (model == NULL)
     
    9595        psLineAdd (line, "%8.3f", source->apMag);
    9696        psLineAdd (line, "%8.2f\n", apResid);
    97         fwrite (line->line, 1, line->Nline, f);
     97        if (fwrite (line->line, 1, line->Nline, f) < line->Nline) {
     98            psError(PS_ERR_IO, true, "Unable to write OBJ sources file (%s)", filename);
     99            close(f);
     100            psFree(line);
     101            return false;
     102        }
    98103    }
    99104    fclose (f);
Note: See TracChangeset for help on using the changeset viewer.