Ignore:
Timestamp:
03/08/13 17:58:53 (11 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Candidate bug fix for seg. fault on Mac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/ASTEDataset.cc

    r2783 r2785  
    3535#include <iostream>
    3636#include <cstring>
     37
     38#define STRING2CHAR(s) const_cast<char *>((s).c_str())
    3739
    3840using namespace std ;
     
    7981  int arymax = arrayMax();
    8082
    81   string str120( 120, ' ' ) ;
    82   char c120[120] ;
    8383  // make sure file pointer points a beginning of the file
    8484  fseek( fp_, 0, SEEK_SET ) ;
     
    8787
    8888  // specific part
    89   strcpy( c120, str120.c_str() ) ;
    90   if ( readHeader( c120, 116 ) == -1 ) {
     89  CDMY1.resize(116);
     90  if ( readHeader( STRING2CHAR(CDMY1), 116 ) == -1 ) {
    9191    os << LogIO::WARN << "Error while reading data CDMY1." << LogIO::POST ;
    9292    return -1 ;
    9393  }
    94   c120[116] = '\0' ;
    95   CDMY1 = string( c120 ) ;
    9694  // DEBUG
    9795  //cout << "CDMY1 = " << CDMY1 << endl ;
Note: See TracChangeset for help on using the changeset viewer.