summaryrefslogtreecommitdiff
path: root/src/xmlcomposer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlcomposer.cpp')
-rw-r--r--src/xmlcomposer.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp
index b0643e2..80d45af 100644
--- a/src/xmlcomposer.cpp
+++ b/src/xmlcomposer.cpp
@@ -1044,16 +1044,15 @@ bool RtfParser::isEqualElement(const DOM::Element& el1, const DOM::Element& el2)
wstring RtfParser::formatInt(int num)
{
- wchar_t buff[12];
+ char buff[16];
- // The Win32 version isn't secure
-#ifdef _WIN32
- swprintf(buff, L"%d", num);
-#else
- swprintf(buff, 12, L"%d", num);
-#endif
+ // Certain OSs don't support swprintf :(
+ sprintf(buff, "%d", num);
+
+ wstring n;
+ for(char* s = buff; *s; s++)
+ n.append(1, *s);
- wstring n(buff);
return n;
}