Changeset 15906


Ignore:
Timestamp:
08/23/13 15:52:14 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixed string outputs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.cpp

    r15905 r15906  
    1919
    2020        /*input/output*/
    21         char       *name  = NULL;
    22         IssmDouble  value = 0.;
     21        char       *name     = NULL;
     22        bool        isstring = false;
     23        IssmDouble  value   = 0.;
     24        char       *svalue   = NULL;
    2325
    2426        /*Boot module: */
     
    6971        else if(strcmp(name,"_DAKOTA_VERSION_")==0){
    7072                #ifdef _DAKOTA_VERSION_
    71                 value = IssmDouble(_DAKOTA_VERSION_);
     73                isstring = true;
     74                svalue =xNew<char>(strlen(_DAKOTA_VERSION_)+1);
     75                xMemCpy<char>(svalue,_DAKOTA_VERSION_,(strlen(_DAKOTA_VERSION_)+1));
    7276                #else
    7377                _error_("_DAKOTA_VERSION_ not found in config.h");
     
    7983
    8084        /* output: */
    81         WriteData(VALUE,value);
     85        if(isstring)
     86         WriteData(VALUE,svalue);
     87        else
     88         WriteData(VALUE,value);
    8289
    8390        /*Clean up*/
    8491        xDelete<char>(name);
     92        xDelete<char>(svalue);
    8593
    8694        /*end module: */
Note: See TracChangeset for help on using the changeset viewer.