Changeset 2294 for trunk


Ignore:
Timestamp:
09/12/11 17:29:15 (13 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...

Fixed a bug that AsciiWriter causes segmentation fault when
it processes data without rest frequency (empty RESTFREQUENCY
column in MOLECULES table).


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STAsciiWriter.cpp

    r2163 r2294  
    137137    //addLine(of, "Rest Freq.",
    138138    //        stable.molecules().getRestFrequency(rec.asuInt("MOLECULE_ID") ));
    139     addLine(of, "Rest Freq.", restfreqs[0]);
    140     for ( int i=1; i<nf; ++i) {
    141       addLine(of, " ", restfreqs[i]);
     139    if ( nf > 0 ) {
     140      addLine(of, "Rest Freq.", restfreqs[0]);
     141      for ( int i=1; i<nf; ++i) {
     142        addLine(of, " ", restfreqs[i]);
     143      }
     144    }
     145    else {
     146      addLine(of, "Rest Freq.", "NONE" );
    142147    }
    143148    ostringstream osflagrow;
Note: See TracChangeset for help on using the changeset viewer.