From fbf9fe29f9895d47cb08b94cda6f1f88c82f35aa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 23 Jan 2012 11:28:01 +0000 Subject: [PATCH] Avoid warnings about mismatched format string in wxMSW wxClipboard code. Cast the string offsets to "unsigned" explicitly, even though they can be 64 bit (whereas unsigned is 32 bits) under Win64, the strings we operate with here shouldn't be more than 4GiB long. See #13815. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/clipbrd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index da105ae254..55c12d45af 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -332,19 +332,19 @@ bool wxSetClipboardData(wxDataFormat dataFormat, // string when you overwrite it so you follow up with code to replace // the 0 appended at the end with a '\r'... char *ptr = strstr(buf, "StartHTML"); - sprintf(ptr+10, "%08u", strstr(buf, "") - buf); + sprintf(ptr+10, "%08u", (unsigned)(strstr(buf, "") - buf)); *(ptr+10+8) = '\r'; ptr = strstr(buf, "EndHTML"); - sprintf(ptr+8, "%08u", strlen(buf)); + sprintf(ptr+8, "%08u", (unsigned)strlen(buf)); *(ptr+8+8) = '\r'; ptr = strstr(buf, "StartFragment"); - sprintf(ptr+14, "%08u", strstr(buf, "