IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17053


Ignore:
Timestamp:
Mar 19, 2008, 10:23:06 AM (18 years ago)
Author:
Paul Price
Message:

Empty strings were being returned as a single space. Looks like a
logic error due to miscounting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsHeader.c

    r17048 r17053  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-03-19 00:11:36 $
     9 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-03-19 20:23:06 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    218218    // http://archive.stsci.edu/fits/fits_standard/node31.html
    219219    char *lastSpace = NULL; // The last space in the string
    220     while (strlen(fixed) > 1 && (lastSpace = strrchr(fixed, ' ')) && lastSpace[1] == '\0') {
     220    while (strlen(fixed) > 0 && (lastSpace = strrchr(fixed, ' ')) && lastSpace[1] == '\0') {
    221221        // This is a trailing space, not a leading space.
    222222        lastSpace[0] = '\0'; // Truncate the string here
Note: See TracChangeset for help on using the changeset viewer.