diff options
author | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
commit | 6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch) | |
tree | 91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /dep/src/g3dlite/format.cpp | |
parent | 2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff) | |
parent | f385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'dep/src/g3dlite/format.cpp')
-rw-r--r-- | dep/src/g3dlite/format.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dep/src/g3dlite/format.cpp b/dep/src/g3dlite/format.cpp index 6def987c21b..8737128a0f8 100644 --- a/dep/src/g3dlite/format.cpp +++ b/dep/src/g3dlite/format.cpp @@ -52,7 +52,7 @@ std::string vformat(const char *fmt, va_list argPtr) { // allocate it on the stack because this saves // the malloc/free time. const int bufSize = 161; - char stackBuffer[bufSize]; + char stackBuffer[bufSize]; int actualSize = _vscprintf(fmt, argPtr) + 1; @@ -68,7 +68,7 @@ std::string vformat(const char *fmt, va_list argPtr) { heapBuffer[maxSize] = '\0'; } else { heapBuffer = (char*)System::malloc(actualSize); - vsprintf(heapBuffer, fmt, argPtr); + vsprintf(heapBuffer, fmt, argPtr); } std::string formattedString(heapBuffer); @@ -91,7 +91,7 @@ std::string vformat(const char *fmt, va_list argPtr) { // allocate it on the stack because this saves // the malloc/free time. const int bufSize = 161; - char stackBuffer[bufSize]; + char stackBuffer[bufSize]; int actualWritten = vsnprintf(stackBuffer, bufSize, fmt, argPtr); @@ -101,7 +101,7 @@ std::string vformat(const char *fmt, va_list argPtr) { int heapSize = 512; double powSize = 1.0; char* heapBuffer = (char*)System::malloc(heapSize); - + while ((vsnprintf(heapBuffer, heapSize, fmt, argPtr) == -1) && (heapSize < maxSize)) { @@ -144,7 +144,7 @@ std::string vformat(const char* fmt, va_list argPtr) { assert(numChars2 == numChars); std::string result(heapBuffer); - + System::free(heapBuffer); return result; |