IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15109


Ignore:
Timestamp:
Sep 29, 2007, 11:54:35 AM (19 years ago)
Author:
Paul Price
Message:

Fixing SEGVs in keywordInList.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_070920/psLib/src/fits/psFitsHeader.c

    r14985 r15109  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.34.4.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-09-22 03:08:05 $
     9 *  @version $Revision: 1.34.4.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-09-29 21:54:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3636
    3737// list of FITS header keys to ignore; NULL-terminated
    38 static const char* ignoreFitsKeys[] = {"", NULL};
     38static const char* ignoreFitsKeys[] = { "", NULL};
    3939
    4040// List of FITS header keys that may be duplicated; NULL-terminated
    41 static const char *duplicateFitsKeys[] = {"COMMENT", "HIERARCH", "HISTORY", NULL};
     41static const char *duplicateFitsKeys[] = { "COMMENT", "HIERARCH", "HISTORY", NULL};
    4242
    4343// List of FITS header keys not to write (handled by cfitsio); NULL-terminated
    44 static const char *noWriteFitsKeys[] = {"SIMPLE", "XTENSION", "BITPIX", "NAXIS", "EXTNAME", "BSCALE", "BZERO",
    45                                         "TFIELDS", NULL};
     44static const char *noWriteFitsKeys[] = { "SIMPLE", "XTENSION", "BITPIX", "NAXIS", "EXTNAME", "BSCALE",
     45                                         "BZERO", "TFIELDS", NULL};
    4646
    4747// List of the start of FITS header keys not to write (handled by cfitsio); NULL-terminated
    48 static const char *noWriteFitsKeyStarts[] = {"NAXIS", "TTYPE", "TFORM", NULL};
     48static const char *noWriteFitsKeyStarts[] = { "NAXIS", "TTYPE", "TFORM", NULL};
    4949
    5050// List of FITS header keys that may be present if the header is considered "empty"; NULL-terminated
     
    5757    )
    5858{
    59     for (const char **check = list; *check; *check++) {
     59    for (const char **check = list; *check; ++check) {
    6060        if (strcmp(keyword, *check) == 0) {
    6161            return true;
     
    7171    PS_ASSERT_METADATA_NON_NULL(header, false);
    7272
    73     int hduNum = 0;                     // Which HDU we're at
    74     fits_get_hdu_num(fits->fd, &hduNum);  /* Get the current output HDU position */
    75 
    76     if (hduNum != 1) {
     73    if (psFitsGetExtNum(fits) != 0) {
    7774        // It's not the PHU, so it can't be an empty PHU!
    7875        return false;
     
    9390        }
    9491    }
     92    psFree(iter);
    9593
    9694    return true;
Note: See TracChangeset for help on using the changeset viewer.