summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/win/ClipboardUtilitiesWin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/win/ClipboardUtilitiesWin.cpp')
-rw-r--r--WebCore/platform/win/ClipboardUtilitiesWin.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index 0130a70..19888bf 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -33,7 +33,9 @@
#include "markup.h"
#include <shlwapi.h>
#include <wininet.h> // for INTERNET_MAX_URL_LENGTH
+#include <wtf/StringExtras.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringConcatenate.h>
#if PLATFORM(CF)
#include <CoreFoundation/CoreFoundation.h>
@@ -239,7 +241,11 @@ void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& re
unsigned endFragmentOffset = startFragmentOffset + markupUTF8.length();
unsigned endHTMLOffset = endFragmentOffset + strlen(endMarkup);
- append(result, String::format(header, startHTMLOffset, endHTMLOffset, startFragmentOffset, endFragmentOffset).utf8());
+ unsigned headerBufferLength = startHTMLOffset + 1; // + 1 for '\0' terminator.
+ char* headerBuffer = (char*)malloc(headerBufferLength);
+ snprintf(headerBuffer, headerBufferLength, header, startHTMLOffset, endHTMLOffset, startFragmentOffset, endFragmentOffset);
+ append(result, CString(headerBuffer));
+ free(headerBuffer);
if (sourceURLUTF8.length()) {
append(result, sourceURLPrefix);
append(result, sourceURLUTF8);