Changeset 4778 for vtkvis


Ignore:
Timestamp:
Nov 23, 2014 5:51:14 PM (6 years ago)
Author:
ldelgass
Message:

sync string fix with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vtkvis/branches/1.7/RenderServer.cpp

    r4606 r4778  
    220220VtkVis::getStatsFile(Tcl_Interp *interp, Tcl_Obj *objPtr)
    221221{
    222     Tcl_DString ds;
    223222    Tcl_Obj **objv;
    224223    int objc;
    225224    int i;
    226225    char fileName[33];
    227     const char *path;
    228226    md5_state_t state;
    229227    md5_byte_t digest[16];
     
    247245        sprintf(fileName + i * 2, "%02x", digest[i]);
    248246    }
    249     Tcl_DStringInit(&ds);
    250     Tcl_DStringAppend(&ds, STATSDIR, -1);
    251     Tcl_DStringAppend(&ds, "/", 1);
    252     Tcl_DStringAppend(&ds, fileName, 32);
    253     path = Tcl_DStringValue(&ds);
    254 
    255     g_statsFile = open(path, O_EXCL | O_CREAT | O_WRONLY, 0600);
     247    std::ostringstream oss;
     248    oss << STATSDIR << "/" << fileName;
     249    std::string pathStr = oss.str();
     250
     251    g_statsFile = open(pathStr.c_str(), O_EXCL | O_CREAT | O_WRONLY, 0600);
    256252    Tcl_DStringFree(&ds);
    257253    if (g_statsFile < 0) {
    258         ERROR("can't open \"%s\": %s", fileName, strerror(errno));
     254        ERROR("can't open \"%s\": %s", pathStr.c_str(), strerror(errno));
    259255        return -1;
    260256    }
Note: See TracChangeset for help on using the changeset viewer.