Changeset 1633


Ignore:
Timestamp:
01/09/19 18:14:16 (4 months ago)
Author:
oabramkina
Message:

Bugfix on writing axis and scalar labels: pre-incrementing a blitz array iterator was causing a segmentation fault in production mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/io/onetcdf4_impl.hpp

    r1632 r1633  
    6060    CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend(); 
    6161  
    62     int dimArrayLen; 
     62    int dimArrayLen = 0; 
    6363    for (int i=0; i<scount.size(); i++) 
    6464      if (scount[i] == stringArrayLen) 
     
    7676    Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 
    7777    int lineNb = 0; 
    78     for(it=itb;it!=ite;++it) 
     78    for(it=itb;it!=ite;it++) 
    7979    { 
    8080      it->copy(PtrArrayStr,it->size()) ; 
     
    8383      sstart[dimArrayLen] = 0; 
    8484      scount[0] = 1; 
    85       scount[dimArrayLen] = it->size() + 1; 
     85      scount[dimArrayLen] = it->size()+1; 
    8686      CTimer::get("CONetCDF4::writeData writeData_").resume(); 
    8787      this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 
Note: See TracChangeset for help on using the changeset viewer.