From 5c2430e6896de2139bf8e5e467dd3a6ba527f46a Mon Sep 17 00:00:00 2001 From: Stef Date: Wed, 31 Mar 2004 22:25:56 +0000 Subject: Changes for FreeBSD compatibility --- src/xmlcomposer.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/xmlcomposer.cpp') 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; } -- cgit v1.2.3