version 1.19.10.1, 2013/01/02 05:59:11
|
version 1.19.10.2, 2013/01/12 06:32:50
|
|
|
// named "cimserver.trc.1" and so on ... | // named "cimserver.trc.1" and so on ... |
fclose(_fileHandle); | fclose(_fileHandle); |
| |
char buffer[22]; |
char buf[1024]; |
Uint32 sz; |
sprintf(buf, "%s.%u", _baseFileName, ++_fileCount); |
++_fileCount; |
|
String cntStr = Uint16ToString(buffer, _fileCount, sz); |
|
String newTrcFile = _baseFileName + cntStr; |
|
| |
//Holds current trace file name for rolling back in case of failure | //Holds current trace file name for rolling back in case of failure |
char lastTraceFileName [strlen(_fileName) +1 ]; | char lastTraceFileName [strlen(_fileName) +1 ]; |
|
|
free(_fileName); | free(_fileName); |
_fileName = 0; | _fileName = 0; |
| |
// 2 extra bytes, one for trailling NUL and other for . appended |
// 1 extra bytes for trailling NUL |
_fileName = (char*)malloc(newTrcFile.size() + 2); |
_fileName = (char*)malloc(strlen(buf) + 1 ); |
if(_fileName) | if(_fileName) |
{ | { |
sprintf(_fileName, "%s.%u", _baseFileName, _fileCount); | sprintf(_fileName, "%s.%u", _baseFileName, _fileCount); |