Changeset 1923


Ignore:
Timestamp:
Apr 28, 2009, 8:10:17 PM (12 years ago)
Author:
Peter
Message:

refs #510 - avoid problem with empty lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/utility.h

    r1922 r1923  
    252252      std::stringstream ss(line);
    253253      load(ss, v, sep);
    254       if(sep!='\0' && line[line.size()-1]==sep) // add NaN for final separator
    255           v.push_back(std::numeric_limits<T>::quiet_NaN());
     254      // add NaN for final separator
     255      if(sep!='\0' && !line.empty() && line[line.size()-1]==sep)
     256        v.push_back(std::numeric_limits<T>::quiet_NaN());
    256257      nof_columns = std::max(nof_columns, v.size());
    257258    }
Note: See TracChangeset for help on using the changeset viewer.