Skip Menu |

This queue is for tickets about the Astro-FITS-Header CPAN distribution.

Report information
The Basics
Id: 11722
Status: resolved
Worked: 3 min
Priority: 0/
Queue: Astro-FITS-Header

People
Owner: Nobody in particular
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Empty COMMENT cards read by CFITSIO cause warnings
The CFITSIO fits_get_record routine removes blanks at the end of records. When AFHI::parse_card process an empty COMMENT card, it gets the string 'COMMENT', which is only 7 chars long. It tries to substr($card,8), which causes perl to gripe about misuse of substr and uninitialized values. The attached patch addresses this behavior
*** Astro-FITS-Header-2.8.1.old/Item/Item.pm Wed Jul 2 12:25:03 2003 --- Astro-FITS-Header-2.8.1.new/Item/Item.pm Wed Mar 2 15:04:16 2005 *************** *** 412,419 **** # Store the type $self->type( "COMMENT" ); ! # We have comments ! $comment = substr($card,8); $comment =~ s/\s+$//; # Trailing spaces # Alasdair wanted to store this as a value --- 412,424 ---- # Store the type $self->type( "COMMENT" ); ! # We have comments. ! ! # CFITSIO removes blank spaces at the end of cards, so blank ! # comment cards are reduced to just the word 'COMMENT' which ! # causes substr to throw a fit when asked for things after ! # the end of the string ! $comment = substr($card,8) if length($card) > 8; $comment =~ s/\s+$//; # Trailing spaces # Alasdair wanted to store this as a value
On Wed Mar 02 15:16:02 2005, DJERIUS wrote: Show quoted text
> The CFITSIO fits_get_record routine removes blanks at the end of > records. > > When AFHI::parse_card process an empty COMMENT card, it gets the > string 'COMMENT', which is only 7 chars long. It tries to > substr($card,8), which causes perl to gripe about misuse of substr > and uninitialized values. > > The attached patch addresses this behavior
That looks to have been fixed in CVS in Feb 2004 (!)
Fixed in v3.0 on CPAN