more snprintf...

parent 6e10fe25
This diff is collapsed.
......@@ -153,11 +153,11 @@ FileLogHandler::createNewFile()
if (fileNo >= m_maxNoFiles)
{
fileNo = 1;
::snprintf(newName, sizeof(newName),
BaseString::snprintf(newName, sizeof(newName),
"%s.%d", m_pLogFile->getName(), fileNo);
break;
}
::snprintf(newName, sizeof(newName),
BaseString::snprintf(newName, sizeof(newName),
"%s.%d", m_pLogFile->getName(), fileNo++);
} while (File_class::exists(newName));
......
......@@ -45,7 +45,7 @@ LogHandler::getDefaultHeader(char* pStr, const char* pCategory,
Logger::LoggerLevel level) const
{
char time[MAX_DATE_TIME_HEADER_LENGTH];
::snprintf(pStr, MAX_HEADER_LENGTH, "%s [%s] %s -- ",
BaseString::snprintf(pStr, MAX_HEADER_LENGTH, "%s [%s] %s -- ",
getTimeAsString((char*)time),
pCategory,
Logger::LoggerLevelNames[level]);
......@@ -84,7 +84,7 @@ LogHandler::getTimeAsString(char* pStr) const
tm_now = ::localtime(&now); //uses the "current" timezone
#endif
::snprintf(pStr, MAX_DATE_TIME_HEADER_LENGTH,
BaseString::snprintf(pStr, MAX_DATE_TIME_HEADER_LENGTH,
m_pDateTimeFormat,
tm_now->tm_year + 1900,
tm_now->tm_mon + 1, //month is [0,11]. +1 -> [1,12]
......
......@@ -128,7 +128,7 @@ LogHandlerListUnitTest::testTraverseNext(const char* msg)
{
char* str = new char[3];
pHandlers[i] = new ConsoleLogHandler();
::snprintf(str, 3, "%d", i);
BaseString::snprintf(str, 3, "%d", i);
pHandlers[i]->setDateTimeFormat(str);
list.add(pHandlers[i]);
}
......
......@@ -86,7 +86,7 @@ NDB_COMMAND(loggertest, "loggertest", "loggertest -console | -file",
{
ndbout << "-- " << " Test " << i + 1
<< " [" << testCases[i].name << "] --" << endl;
::snprintf(str, 256, "%s %s %s %d", "Logging ",
BaseString::snprintf(str, 256, "%s %s %s %d", "Logging ",
testCases[i].name, " message ", i);
if (testCases[i].test(str))
{
......
......@@ -83,7 +83,7 @@ File_class::File_class(const char* aFileName, const char* mode) :
m_file(NULL),
m_fileMode(mode)
{
::snprintf(m_fileName, MAX_FILE_NAME_SIZE, aFileName);
BaseString::snprintf(m_fileName, MAX_FILE_NAME_SIZE, aFileName);
}
bool
......@@ -99,7 +99,7 @@ File_class::open(const char* aFileName, const char* mode)
/**
* Only copy if it's not the same string
*/
::snprintf(m_fileName, MAX_FILE_NAME_SIZE, aFileName);
BaseString::snprintf(m_fileName, MAX_FILE_NAME_SIZE, aFileName);
}
m_fileMode = mode;
bool rc = true;
......
......@@ -346,15 +346,15 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
file_name = "ose_err.h";
}
snprintf (error_message.header1,
BaseString::snprintf(error_message.header1,
BUFSIZE,
"This is the OSE Example System Error handler\r\n");
snprintf (error_message.err_hnd_file,
BaseString::snprintf(error_message.err_hnd_file,
BUFSIZE,
"located in: " __FILE__ "\r\n");
snprintf (error_message.header2,
BaseString::snprintf(error_message.header2,
BUFSIZE,
"An Error has been reported:\r\n");
......@@ -371,28 +371,28 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
user_called);
}
snprintf (error_message.error_code_line,
BaseString::snprintf(error_message.error_code_line,
BUFSIZE,
"error code: 0x%08x\r\n",
error_code);
snprintf (error_message.subcode_line,
BaseString::snprintf(error_message.subcode_line,
BUFSIZE,
" subcode: %s (0x%08x)\r\n",
subcode_mnemonic,
( subcode << 16));
snprintf (error_message.product_line,
BaseString::snprintf(error_message.product_line,
BUFSIZE,
" product: %s\r\n",
product_name);
snprintf (error_message.header_file_line,
BaseString::snprintf(error_message.header_file_line,
BUFSIZE,
" header file: %s\r\n",
file_name);
snprintf (error_message.extra_line,
BaseString::snprintf(error_message.extra_line,
BUFSIZE,
"extra: 0x%08x\r\n",
extra);
......
......@@ -3405,9 +3405,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
s.m_sectionType= BaseString("TCP");
s.m_sectionData= new Properties(true);
char buf[16];
snprintf(buf, sizeof(buf), "%u", nodeId1);
BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1);
s.m_sectionData->put("NodeId1", buf);
snprintf(buf, sizeof(buf), "%u", nodeId2);
BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2);
s.m_sectionData->put("NodeId2", buf);
sections.push_back(s);
}
......@@ -3422,9 +3422,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
s.m_sectionType= BaseString("TCP");
s.m_sectionData= new Properties(true);
char buf[16];
snprintf(buf, sizeof(buf), "%u", nodeId1);
BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1);
s.m_sectionData->put("NodeId1", buf);
snprintf(buf, sizeof(buf), "%u", nodeId2);
BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2);
s.m_sectionData->put("NodeId2", buf);
sections.push_back(s);
}
......
......@@ -103,7 +103,7 @@ void showTime()
now = ::time((time_t*)NULL);
tm_now = ::gmtime(&now);
::snprintf(buf, 128,
BaseString::snprintf(buf, 128,
"%d-%.2d-%.2d %.2d:%.2d:%.2d",
tm_now->tm_year + 1900,
tm_now->tm_mon,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment