IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 1, 2008, 8:33:14 AM (18 years ago)
Author:
Paul Price
Message:

Need to check return value of fwrite to avoid compiler warning on some
systems. It's a good thing to do anyway.

File:
1 edited

Legend:

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

    r15562 r18845  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-11-10 01:09:20 $
     5 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-08-01 18:33:01 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    113113        pmSource *source = (pmSource *) sources->data[i];
    114114
    115         // no difference between PSF and non-PSF model
     115        // no difference between PSF and non-PSF model
    116116        pmModel *model = pmSourceGetModel (NULL, source);
    117117        if (model == NULL)
     
    140140        psLineAdd (line, "%6.2f ",  axes.minor);
    141141        psLineAdd (line, "%5.1f\n", axes.theta);
    142         fwrite (line->line, 1, line->Nline, f);
     142        if (fwrite(line->line, 1, line->Nline, f) < line->Nline) {
     143            psError(PS_ERR_IO, true, "Unable to write CMP sources file (%s)", filename);
     144            fclose(f);
     145            psFree(line);
     146            return false;
     147        }
    143148    }
    144149    fclose (f);
     
    233238                int Nskip = c2 - c;
    234239                nbytes -= Nskip;
    235                 memset(buffer + nbytes, '\0', Nskip);
     240                memset(buffer + nbytes, '\0', Nskip);
    236241                psLogMsg (__func__, 4, "deleted line, %d extra chars\n", Nskip);
    237242            } else {
     
    277282                goto skip_source;
    278283
    279             pmPSF_AxesToModel (PAR, axes);
     284            pmPSF_AxesToModel (PAR, axes);
    280285
    281286            psArrayAdd (sources, 100, source);
Note: See TracChangeset for help on using the changeset viewer.